Since upgrading our application from GWT 1.4.60 to 1.5.2 we're running into issues with our Custom Exceptions that should be getting thrown across an RPC call. We have a number of Custom Exceptions that extend from java.lang.Exception, nothing fancy going on with them, just business logic exceptions with some String instance variables.
In 1.4 if a Custom Exception was thrown on the Server side during an RPC call that exception would successfully come back to the client in onFailure() so we could show the appropriate error message to the user or handle it. However, since the 1.5 upgrade, none of our Custom Exceptions can make it back to the client. What's happening is that RequestCallbackAdapter.onResponseReceived() gets the correct Exception but throws a IncompatibleRemoteServiceException into the onFailure() method. Tracing it down it's because a SerializationException is being thrown in ModuleSpace; it's blowing up during scrubStackTrace(). Getting the generic IncompatibleRemoteServiceException in onFailure() makes it impossible to properly handle the issue or display a useful message to the user. All other objects work across an RPC call, the problem is only with Exceptions. No errors or warning are thrown during compilation, and all of our Custom Exceptions appear and look good in the *.gwt.rpc and *.rpc.log files. This problem occurs in both Hosted and Web mode. There have been numerous clean deploys to the server and the gwt- servlet.jar is up to date. Did I miss something obvious during the upgrade or are other people running into this issue as well? Maybe something with how Throwable now implements Serializable. I've looked through the Forum and Issue Tracker and found some posts about similiar issues, but nothing with a definitaive solution. + (http://groups.google.com/group/Google-Web-Toolkit/browse_thread/ thread/4b08fc1495e023ad/770ffb277364f04b?lnk=gst&q=custom +exceptions#770ffb277364f04b) + (http://groups.google.com/group/Google-Web-Toolkit/browse_thread/ thread/d73014cb612419e4/6739b73a03baeabb? lnk=gst&q=IncompatibleRemoteServiceException#6739b73a03baeabb) Sample Code: ========== public class CustomException extends Exception implements Serializable{ private String userMsg, techMsg; public CustomException(){} public CustomException(String userMsg, String techMsg){...} get/Set User/TechMsg(){} public String toString(){...} } public class SomeBizLogicException extends CustomException{ public SomeBizLogicException(){super();} public SomeBizLogicException(String userMsg, String techMsg) {super(..);} } public interface XService extends RemoteService{ public List<String> getSomething() throws CustomException; } public class XServiceImpl extends RemoteServiceServlet implements XService{ public List<String> getSomething() throws CustomException { /* Some biz logic goes wrong ! */ throw new SomeBizLogicException("a", "b"); } } Sample Stack Trace: =============== com.google.gwt.user.client.rpc.IncompatibleRemoteServiceException: This application is out of date, please click the refresh button on your browser. at com.google.gwt.user.client.rpc.impl.RequestCallbackAdapter.onResponseReceived(RequestCallbackAdapter.java: 204) at com.google.gwt.http.client.Request.fireOnResponseReceivedImpl(Request.java: 254) at com.google.gwt.http.client.Request.fireOnResponseReceivedAndCatch(Request.java: 226) at com.google.gwt.http.client.Request.fireOnResponseReceived(Request.java: 217) 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.google.gwt.dev.shell.MethodAdaptor.invoke(MethodAdaptor.java: 103) at com.google.gwt.dev.shell.ie.IDispatchImpl.callMethod(IDispatchImpl.java: 126) at com.google.gwt.dev.shell.ie.IDispatchProxy.invoke(IDispatchProxy.java: 155) at com.google.gwt.dev.shell.ie.IDispatchImpl.Invoke(IDispatchImpl.java: 294) at com.google.gwt.dev.shell.ie.IDispatchImpl.method6(IDispatchImpl.java: 194) at org.eclipse.swt.internal.ole.win32.COMObject.callback6(COMObject.java: 117) at org.eclipse.swt.internal.win32.OS.DispatchMessageW(Native Method) at org.eclipse.swt.internal.win32.OS.DispatchMessage(OS.java:1925) at org.eclipse.swt.widgets.Display.readAndDispatch(Display.java:2966) at com.google.gwt.dev.GWTShell.pumpEventLoop(GWTShell.java:720) at com.google.gwt.dev.GWTShell.run(GWTShell.java:593) at com.google.gwt.dev.GWTShell.main(GWTShell.java:357) --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Google Web Toolkit" group. To post to this group, send email to [email protected] To unsubscribe from this group, send email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/Google-Web-Toolkit?hl=en -~----------~----~----~----~------~----~------~--~---
