Hi Isomorphic,
I'm using a fake serverside DSResponse in order to remove data from a client side ListGrid. The request sent was a customOperation request.
I try to piggyback that DSResponse to another one like the following:
I get the following error in the server log:
As the whole code is independent of any outer variables you should be able to reproduce easily.
Perhaps it is also enough if you could tell me what variable exactly is used in DSResponse.java:888? Perhaps I forgot some important value when faking my response.
I'm using today's v10.0p_2015-08-18/PowerEdition Deployment.
Thank you & Best regards
Blama
I'm using a fake serverside DSResponse in order to remove data from a client side ListGrid. The request sent was a customOperation request.
I try to piggyback that DSResponse to another one like the following:
Code:
DSResponse returnResponse = new DSResponse(sourceDatasource, DSResponse.STATUS_SUCCESS);//sourceDatasource is a String // Return a response that triggers a remove of the specific row at the client side DSResponse piggybackResponse = new DSResponse(sourceDatasource, DSResponse.STATUS_SUCCESS);//sourceDatasource is a String /* Search for setData in Server Showcase source (sample\showcase\SERVER!) or see * http://www.smartclient.com/smartgwtee/server/javadoc/com/isomorphic/datasource/DSResponse.html#setData%28java.lang.Object%29 * What happens here is that we fake a entry-removed response. */ piggybackResponse.setOperationType(DataSource.OP_REMOVE); List<Map<String, Object>> recordList = new ArrayList<Map<String, Object>>(); Map<String, Object> record = new HashMap<String, Object>(); record.put("LEAD_ID", leadId); //leadId is some Long recordList.add(record); piggybackResponse.setData(recordList); piggybackResponse.setAffectedRows(1); returnResponse.addRelatedUpdate(piggybackResponse); return returnResponse;
Code:
=== 2015-08-18 18:45:45,121 [c-14] DEBUG DataSourceDMI - Invocation threw exception java.lang.NullPointerException at com.isomorphic.datasource.DSResponse.addRelatedUpdate(DSResponse.java:888) at com.lmscompany.lms.server.worker.V_LEAD_CURRENT.removeLead(V_LEAD_CURRENT.java:426) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source) at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source) at java.lang.reflect.Method.invoke(Unknown Source) at com.isomorphic.base.Reflection.adaptArgsAndInvoke(Reflection.java:975) at com.isomorphic.datasource.DataSourceDMI.execute(DataSourceDMI.java:416) at com.isomorphic.datasource.DataSourceDMI.execute(DataSourceDMI.java:64) at com.isomorphic.datasource.DSRequest.execute(DSRequest.java:2544) at com.isomorphic.servlet.IDACall.handleDSRequest(IDACall.java:220) at com.lmscompany.lms.server.LMSIDACall.handleDSRequest(LMSIDACall.java:75) at com.isomorphic.servlet.IDACall.processRPCTransaction(IDACall.java:185) at com.lmscompany.lms.server.LMSIDACall.processRequest(LMSIDACall.java:40) at com.isomorphic.servlet.IDACall._processRequest(IDACall.java:117) at com.isomorphic.servlet.IDACall.doPost(IDACall.java:76) at javax.servlet.http.HttpServlet.service(HttpServlet.java:647) at com.isomorphic.servlet.BaseServlet.service(BaseServlet.java:156) at javax.servlet.http.HttpServlet.service(HttpServlet.java:728) at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:305) at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:210) at org.apache.tomcat.websocket.server.WsFilter.doFilter(WsFilter.java:52) at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:243) at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:210) at com.isomorphic.servlet.CompressionFilter._doFilter(CompressionFilter.java:260) at com.isomorphic.servlet.BaseFilter.doFilter(BaseFilter.java:83) 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:222) at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:123) at org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:611) at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:171) at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:100) at org.apache.catalina.valves.AccessLogValve.invoke(AccessLogValve.java:953) at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:118) at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:409) at org.apache.coyote.http11.AbstractHttp11Processor.process(AbstractHttp11Processor.java:1044) at org.apache.coyote.AbstractProtocol$AbstractConnectionHandler.process(AbstractProtocol.java:607) at org.apache.tomcat.util.net.JIoEndpoint$SocketProcessor.run(JIoEndpoint.java:315) at java.util.concurrent.ThreadPoolExecutor.runWorker(Unknown Source) at java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown Source) at java.lang.Thread.run(Unknown Source)
Perhaps it is also enough if you could tell me what variable exactly is used in DSResponse.java:888? Perhaps I forgot some important value when faking my response.
I'm using today's v10.0p_2015-08-18/PowerEdition Deployment.
Thank you & Best regards
Blama
Comment