Dear all, I have a problem with a GWT application (*not pure GWT but SmartGWT*): I have created dedicated classes for each window that I want to render (MVP model); every time I want to switch between windows I call destroy method to the layout that I want to close and I launch a custom event in order to load the new page (with related Layout).
The problem is that sometimes (I was not able to find a predefined pattern) the method MyCurrentLoadedLayout.destroy() (example class name), called from my current loaded layout, throws an exception and the program crash. This is the exception that has been launched: Code: java.lang.ClassCastException: null at java.lang.Class.cast(Class.java:2990) at com.google.gwt.dev.shell.JsValueGlue.get(JsValueGlue.java:169) at com.google.gwt.dev.shell.MethodDispatch.invoke(MethodDispatch.java:57) at com.google.gwt.dev.shell.OophmSessionHandler.invoke(OophmSessionHandler.java:172) at com.google.gwt.dev.shell.BrowserChannelServer.reactToMessagesWhileWaitingForReturn(BrowserChannelServer.java:338) at com.google.gwt.dev.shell.BrowserChannelServer.invokeJavascript(BrowserChannelServer.java:219) at com.google.gwt.dev.shell.ModuleSpaceOOPHM.doInvoke(ModuleSpaceOOPHM.java:136) at com.google.gwt.dev.shell.ModuleSpace.invokeNative(ModuleSpace.java:571) at com.google.gwt.dev.shell.ModuleSpace.invokeNativeVoid(ModuleSpace.java:299) at com.google.gwt.dev.shell.JavaScriptHost.invokeNativeVoid(JavaScriptHost.java:107) at com.smartgwt.client.widgets.BaseWidget.destroy(BaseWidget.java) at com.myTestClass.myTestLayout.destroyLytMain(myTestLayout.java:867) *<--- here there is the command MyCurrentLoadedLayout.destroy() and MyCurrentLoadedLayout is NOT null because it contains all object that are currently displayed on a screen* [...] I am sure that the Layout class is not null because, as I wrote, the major of the time it works correctly: the crash happens randomly when I click on "Logout" button that destroys the current Layout and launches the event that loads the new Layout. This strange behaviour happens, randomly, also when I try to launch an event via EventBus: Code: com.google.gwt.event.shared.UmbrellaException: Exception caught: null at com.google.gwt.event.shared.EventBus.castFireEvent(EventBus.java:69) at com.google.gwt.event.shared.SimpleEventBus.fireEvent(SimpleEventBus.java:57) at com.myTestClass.myTestLayout$10.onSuccess(myTestLayout.java:842) at com.google.gwt.user.client.rpc.impl.RequestCallbackAdapter.onResponseReceived(RequestCallbackAdapter.java:232) at com.google.gwt.http.client.Request.fireOnResponseReceived(Request.java:287) at com.google.gwt.http.client.RequestBuilder$1.onReadyStateChange(RequestBuilder.java:395) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25) at java.lang.reflect.Method.invoke(Method.java:597) at com.google.gwt.dev.shell.MethodAdaptor.invoke(MethodAdaptor.java:103) at com.google.gwt.dev.shell.MethodDispatch.invoke(MethodDispatch.java:71) at com.google.gwt.dev.shell.OophmSessionHandler.invoke(OophmSessionHandler.java:172) at com.google.gwt.dev.shell.BrowserChannelServer.reactToMessagesWhileWaitingForReturn(BrowserChannelServer.java:338) at com.google.gwt.dev.shell.BrowserChannelServer.invokeJavascript(BrowserChannelServer.java:219) at com.google.gwt.dev.shell.ModuleSpaceOOPHM.doInvoke(ModuleSpaceOOPHM.java:136) at com.google.gwt.dev.shell.ModuleSpace.invokeNative(ModuleSpace.java:571) at com.google.gwt.dev.shell.ModuleSpace.invokeNativeObject(ModuleSpace.java:279) [...] Please could you help me understanding what is the cause of the block or can you suggest me how to deeply debug it in order to find the problem? Thank you very much for your support. Best Regards, Marco. -- You received this message because you are subscribed to the Google Groups "Google Web Toolkit" group. To view this discussion on the web visit https://groups.google.com/d/msg/google-web-toolkit/-/54ZUYsOQQeYJ. To post to this group, send email to google-web-toolkit@googlegroups.com. To unsubscribe from this group, send email to google-web-toolkit+unsubscr...@googlegroups.com. For more options, visit this group at http://groups.google.com/group/google-web-toolkit?hl=en.