Announcement

Collapse
No announcement yet.
X
  • Filter
  • Time
Clear All
new posts

    NullPointerException at DSRequest.parseUploadedFiles while trying to upload image

    v8.3p_2013-02-06/EVAL Deployment
    Every Browser

    I'm testing the pro version of SmartClient in order to determine if I must go for it or not.
    So I'm trying to upload an image as binary file and this is the result:
    Code:
    === 2013-02-08 13:17:45,008 [c-19] DEBUG IDACall - Header Name:Value pair: host:localhost:8084
    === 2013-02-08 13:17:45,009 [c-19] DEBUG IDACall - Header Name:Value pair: connection:keep-alive
    === 2013-02-08 13:17:45,009 [c-19] DEBUG IDACall - Header Name:Value pair: content-length:5401
    === 2013-02-08 13:17:45,009 [c-19] DEBUG IDACall - Header Name:Value pair: cache-control:max-age=0
    === 2013-02-08 13:17:45,009 [c-19] DEBUG IDACall - Header Name:Value pair: accept:text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8
    === 2013-02-08 13:17:45,009 [c-19] DEBUG IDACall - Header Name:Value pair: origin:http://localhost:8084
    === 2013-02-08 13:17:45,009 [c-19] DEBUG IDACall - Header Name:Value pair: user-agent:Mozilla/5.0 (Windows NT 6.1; WOW64) AppleWebKit/537.17 (KHTML, like Gecko) Chrome/24.0.1312.57 Safari/537.17
    === 2013-02-08 13:17:45,009 [c-19] DEBUG IDACall - Header Name:Value pair: content-type:multipart/form-data; boundary=----WebKitFormBoundaryZQrAhSQ80nnjKk3a
    === 2013-02-08 13:17:45,009 [c-19] DEBUG IDACall - Header Name:Value pair: referer:http://localhost:8084/WebSDP/WebDesktop.jsf
    === 2013-02-08 13:17:45,009 [c-19] DEBUG IDACall - Header Name:Value pair: accept-encoding:gzip,deflate,sdch
    === 2013-02-08 13:17:45,010 [c-19] DEBUG IDACall - Header Name:Value pair: accept-language:es-ES,es;q=0.8
    === 2013-02-08 13:17:45,010 [c-19] DEBUG IDACall - Header Name:Value pair: accept-charset:ISO-8859-1,utf-8;q=0.7,*;q=0.3
    === 2013-02-08 13:17:45,010 [c-19] DEBUG IDACall - Header Name:Value pair: cookie:JSESSIONID=B741DBC4B65E8599F993A6AC3B37DA4A; GLog=%7B%0D%20%20%20%20left%3A482%2C%20%0D%20%20%20%20top%3A0%2C%20%0D%20%20%20%20width%3A889%2C%20%0D%20%20%20%20height%3A664%2C%20%0D%20%20%20%20priorityDefaults%3A%7B%0D%20%20%20%20%20%20%20%20Log%3A4%0D%20%20%20%20%7D%2C%20%0D%20%20%20%20defaultPriority%3A3%2C%20%0D%20%20%20%20trackRPC%3Anull%0D%7D; isc_cState=ready; JSESSIONID=21177AC80A397A712C1D7C3D498A5707
    === 2013-02-08 13:17:45,010 [c-19] DEBUG IDACall - session exists: B741DBC4B65E8599F993A6AC3B37DA4A
    === 2013-02-08 13:17:45,010 [c-19] DEBUG IDACall - remote user: null
    === 2013-02-08 13:17:45,011 [c-19] INFO  RequestContext - URL: '/WebSDP/isomorphic/IDACall', User-Agent: 'Mozilla/5.0 (Windows NT 6.1; WOW64) AppleWebKit/537.17 (KHTML, like Gecko) Chrome/24.0.1312.57 Safari/537.17': Safari with Accept-Encoding header
    === 2013-02-08 13:17:45,038 [c-19] DEBUG XML - Parsed XML from (in memory stream): 5ms
    === 2013-02-08 13:17:45,054 [c-19] DEBUG RPCManager - Processing 1 requests.
    === 2013-02-08 13:17:45,055 [c-19] ERROR IDACall - Top-level servlet error: 
    java.lang.NullPointerException
    	at com.isomorphic.datasource.DSRequest.parseUploadedFiles(DSRequest.java:563)
    	at com.isomorphic.datasource.DSRequest.<init>(DSRequest.java:541)
    	at com.isomorphic.rpc.RPCManager.parseRequest(RPCManager.java:1994)
    	at com.isomorphic.rpc.RPCManager.<init>(RPCManager.java:284)
    	at com.isomorphic.rpc.RPCManager.<init>(RPCManager.java:269)
    	at com.isomorphic.servlet.IDACall.processRequest(IDACall.java:133)
    	at com.isomorphic.servlet.IDACall.doPost(IDACall.java:74)
    	at javax.servlet.http.HttpServlet.service(HttpServlet.java:641)
    	at com.isomorphic.servlet.BaseServlet.service(BaseServlet.java:152)
    	at javax.servlet.http.HttpServlet.service(HttpServlet.java:722)
    	at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:305)
    	at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:210)
    	at org.netbeans.modules.web.monitor.server.MonitorFilter.doFilter(MonitorFilter.java:393)
    	at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:243)
    	at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:210)
    	at com.sdp.initModules.LoginFilter.doFilter(LoginFilter.java:101)
    	at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:243)
    	at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:210)
    	at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:225)
    	at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:169)
    	at org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:472)
    	at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:168)
    	at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:98)
    	at org.apache.catalina.valves.AccessLogValve.invoke(AccessLogValve.java:927)
    	at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:118)
    	at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:407)
    	at org.apache.coyote.http11.AbstractHttp11Processor.process(AbstractHttp11Processor.java:999)
    	at org.apache.coyote.AbstractProtocol$AbstractConnectionHandler.process(AbstractProtocol.java:565)
    	at org.apache.tomcat.util.net.JIoEndpoint$SocketProcessor.run(JIoEndpoint.java:307)
    	at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1110)
    	at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:603)
    	at java.lang.Thread.run(Thread.java:722)
    The sample code is this:
    Code:
    return isc.DataSource.create({
           id:"PhotoDS",
           serverConstructor:"com.sdp.servlets.ImageServlet",
           fields:[
               {name:"photo",type:"binary"}
           ]
        });
    isc.DynamicForm.create({
                    ID:"employeePhoto_$$",
                    dataSource: photoDS,
                    numCols: 2,
                    width:"100%",
                    fields : [
                        {name:"photo"}
                        //{name:"photo", type:"imageFile"}
                    ]
                 });
    For send the image to the server I call
    Code:
    employeePhoto_$$.saveData();
    And in the server side I have a servlet wich implements the execute functions, but I put some breakpoints on it and they are never reached.

    #2
    This stack trace suggests an empty or faulty server-side DataSource definition (.ds.xml file). You need a valid server-side DataSource definition to upload files to a DataSource.

    If you think the definition is already present and valid, please post it here.

    Comment


      #3
      JSON compatibility

      Originally posted by Isomorphic View Post
      This stack trace suggests an empty or faulty server-side DataSource definition (.ds.xml file). You need a valid server-side DataSource definition to upload files to a DataSource.

      If you think the definition is already present and valid, please post it here.
      Ok, this file was missing, now I would like to know if I can somehow use the smartclient upload file facility but keeping my current architecture that uses mostly JSON messages for communication between client and server and RestDatasource.

      Regards.

      Comment


        #4
        You can leave all of your other operations intact if you like. If you are specifically using our server features for parsing the uploaded file, turning it into normal DSRequest and having it persisted automatically, the upload operation must go through IDACall and there must be a correct .ds.xml file in existence.

        Comment

        Working...
        X