I am getting ClassCastException only on production code but not on DevMode!

78 views
Skip to first unread message

Mohammad Al Quraian

unread,
Feb 13, 2014, 2:43:08 AM2/13/14
to google-we...@googlegroups.com
Hi,

I am developing multi-module project, each project is by its own a GWT project. 2 of these project throw these exception when I run them. The exception is:
Uncaught java.lang.RuntimeException: java.lang.ClassCastException

The javascript code that throw that is:
function com_google_gwt_core_client_impl_Impl_entry__Lcom_google_gwt_core_client_JavaScriptObject_2Lcom_google_gwt_core_client_JavaScriptObject_2(jsFunction){
  return function(){
    try {
      return com_google_gwt_core_client_impl_Impl_entry0__Ljava_lang_Object_2Ljava_lang_Object_2Ljava_lang_Object_2Ljava_lang_Object_2(jsFunction, this, arguments);
    }
     catch (e) {
      throw e;
    }
  }
  ;
}

They are all maven projects with the same structure and dependencies, the home.xml files are similar. I can't figure out what's wrong, especially because they run fine on devmode. The exception happens on all major browsers.

Any idea what's going on?

Thomas Broyer

unread,
Feb 13, 2014, 4:19:30 AM2/13/14
to google-we...@googlegroups.com
Put a breakpoint on that throw line and look at the jsFunction.
Alternatively, possibly look at the stacktrace of the 'e' exception.

Mohammad Al Quraian

unread,
Feb 16, 2014, 5:17:34 AM2/16/14
to google-we...@googlegroups.com
Thanks Thomas for replaying. This is the content of the jsFunction:

function (){ handler.onReadyStateChange__Lcom_google_gwt_xhr_client_XMLHttpRequest_2V(_this); }

I know it's a long shot but do you know what might be the problem?

Thanks for your ongoing help, I appreciate it.


--
You received this message because you are subscribed to a topic in the Google Groups "Google Web Toolkit" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/google-web-toolkit/6AEXM5Dnmvw/unsubscribe.
To unsubscribe from this group and all its topics, send an email to google-web-tool...@googlegroups.com.
To post to this group, send email to google-we...@googlegroups.com.
Visit this group at http://groups.google.com/group/google-web-toolkit.
For more options, visit https://groups.google.com/groups/opt_out.

Thomas Broyer

unread,
Feb 16, 2014, 7:49:43 AM2/16/14
to google-we...@googlegroups.com
Ok, so now you have to determine the type of that handler object. Again I'd recommend looking at the exception stack trace.

Also, if you use GWT 2.6, use -saveSource at compile-time and enable source maps, that way you can debug the Java code in the browser.

Reply all
Reply to author
Forward
0 new messages