We have used the Isomorphic Data sources to integrate the data interactions. But even when there is an exception on server side (any Java exception , like NPE) , the Data source’s execute callback is invoked.
I have also defined addHandleErrorHandler with the logic to handle exceptions , but always the execute method gets invoked in the callback.
That’s not the default behavior (try modifying any sample to have it throw an exception to prove this). Possibly you have set rpcRequest.willHandleError.
If you set willHandleError(true), then it’s expected that the DSCallback is executed. That’s what willHandleError does and is documented to do. Set willHandleError(false), or just leave it unset, to allow DSResponses with an error status to go to the RPCManager HandleErrorCallback.
Note this is totally independent of client-side exception handling and the UncaughtExceptionHandler. The mechanisms discussed above control what happens when an RPCResponse or DSResponse has an error status when received by the client.
The response i Am getting from the Server is
HTTP Response Code : 200
Response Body:
<BR>com.isomorphic.servlet.IDACall top-level exception<BR>
<PRE>
java.lang.NullPointerException
at org.apache.catalina.connector.Request.parseParameters(Request.java:2340)
at org.apache.catalina.connector.Request.getParameter(Request.java:996)
at org.apache.catalina.connector.RequestFacade.getParameter(RequestFacade.java:343)
at javax.servlet.ServletRequestWrapper.getParameter(ServletRequestWrapper.java:157)
at com.isomorphic.rpc.RPCManager.initLog(RPCManager.java:329)
at com.isomorphic.rpc.RPCManager.<init>(RPCManager.java:284)
at com.isomorphic.rpc.RPCManager.<init>(RPCManager.java:271)
at com.isomorphic.servlet.IDACall.processRequest(IDACall.java:90)
at com.isomorphic.servlet.IDACall.doPost(IDACall.java:54)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:709)
at com.isomorphic.servlet.BaseServlet.service(BaseServlet.java:152)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:802)
First of all, as you correctly pointed out here, this exception arises from a limitation in Tomcat. This means that SmartGWT server code is not even involved in this error display - SmartGWT just receives an HTTP 200 (which actually indicates “OK” - it’s not clear why Tomcat uses this code in this case) and the text of the exception.
Whether this is considered a valid response or not is based on your DataSource declaration and how you are calling the DataSource, so please show that code.