Hi,

I'm using the new google-gin AsyncProvider to implement code splitting
in my GWT application. It works well in most situations, but I ran
into a strange issue recently which might hint at a problem in GWT
itself.

My app works well in development mode: I call
myAsyncProvider.get(myCallback) and the code makes it to the
onSuccess() method of my AsyncCallback eventually.

When I compile my app to javascript, however, the code makes it all
the way to myAsyncProvider.get() and beyond, but then neither my
onSuccess() nor my onFailure() is executed. I also get the following
javascript error (compiled with -style DETAILED):
Uncaught ReferenceError:
java_lang_Class_createForClass__Ljava_lang_String_2Ljava_lang_String_2Ljava
_lang_String_2Ljava_lang_Class_2Ljava_lang_Class_2 is not defined

I've pasted the entire generated javascript here:
  http://pastebin.com/iQ44u3bY
The error is on line 322.

I also posted the java files generated by google-gin and GWT there:
AsyncLoader1*.java: http://pastebin.com/b1tfWD9m
AsyncLoader2*.java: http://pastebin.com/7Jh5Rqvv
MyGinjectorImpl.java: http://pastebin.com/cyamcuKg

For info: It's AsyncProvider<MainPagePresenter> that fails. The
AsyncProvider<ResponsePresenter> works fine. Also, if I remove the
AsyncProvider<ResponsePresenter> then the
AsyncProvider<MainPagePresenter> works.

According to Peter Schmitt, "it almost looks as if some piece of code
is calling the GWT function createForClass[1] but can't find it. Maybe
an issue with GWT's code splitting?"

[1] 
http://www.google.com/codesearch/p?hl=en#MTQ26449crI/com/google/gwt/emul/java/lang/Class.java&q=createForClass&sa=N&cd=2&ct=rc


For reference, the original thread on the google-gin board:
http://groups.google.com/group/google-gin/browse_thread/thread/995db1ebccbc3104

-- 
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.

Reply via email to