Dear all, after tons of tests maybe I have figured out what was the 
problem: I think that every exception that I have got can be caused by 
following elements:

1) I use .destroy() method but the best way is to use .markForDestroy() 
method;
2) I use .draw() methods for each element that is part of my main layout 
and then, at the end, I make a call on .show() method of the layout class: 
I have changed my code removing calls to .draw() subclasses and inserting a 
call of .draw() method of my main layout class (instead of using a call to 
.show() method);
3) I use always this. marker in order to identify variables belonging to my 
class but I have read that "this" marker could generate some problem if the 
JNSI function does not correctly map it so I have removed it.

Thank you very much.

Marco.

On Monday, January 14, 2013 10:46:04 PM UTC+1, Marco wrote:
>
> Dear all,
> I am having problems with a GWT program (it is not pure GWT but it makes 
> use of SmartGWT framework) developed using a MVP approach and I need your 
> support: I have created dedicated classes for each window that I want to 
> render; every time I want to switch between "pages" I call destroy method 
> to the "page" that I want to close (i.e. I call destroy method on Layout 
> object) and I launch a custom event in order to load the new "page". The 
> problem is that sometimes (I was not able to find a predefined pattern) the 
> method MyCurrentLoadedLayout.destroy(), called from my current loaded 
> layout, throws an exception and the program crash. 
>
> This is the exception that has been launched:
>
> 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)
>     [...]
>
> I am sure that the Layout class is not null because, as I wrote, the major 
> of the time the code works correctly.
> This strange behavior happens, randomly, also when I try to launch an 
> event via EventBus:
>
> 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)
>     at 
> com.google.gwt.dev.shell.JavaScriptHost.invokeNativeObject(JavaScriptHost.java:91)
>     at com.google.gwt.core.client.impl.Impl.apply(Impl.java)
>     at com.google.gwt.core.client.impl.Impl.entry0(Impl.java:242)
>     at sun.reflect.GeneratedMethodAccessor139.invoke(Unknown Source)
>     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.reactToMessages(BrowserChannelServer.java:293)
>     at 
> com.google.gwt.dev.shell.BrowserChannelServer.processConnection(BrowserChannelServer.java:547)
>     at 
> com.google.gwt.dev.shell.BrowserChannelServer.run(BrowserChannelServer.java:364)
>     at java.lang.Thread.run(Thread.java:680)
>
> Please could you help me understanding which is the problem? What can I do 
> in order to figure out what is the cause?
> Thank you vey much for your help and 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/-/qVf7Z9FRsKwJ.
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.

Reply via email to