Error in compiled version of AsyncProvider

53 views
Skip to first unread message

PhilBeaudoin

unread,
Apr 9, 2010, 3:42:17 PM4/9/10
to google-gin
I've been a happy user of the AsyncProvider for a while now, however I
ran into a strange problem recently and I've narrowed it down to what
I think is code generated by the AsyncProvider.

Here's my problem...

When running my app in development mode, everything works fine. 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, it make it all the way
to myAsyncProvider.get() and beyond. (I confirmed with a
Window.alert()), but the 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 don't have a minimal example where this happens, but you can look at
my MVP implementation of the GWT sample at:
http://code.google.com/p/gwt-platform/
The SVN repository for this sample is:
http://gwt-platform.googlecode.com/svn/samples/gwtpsample
Starting this in development mode works, but you'll get the error when
compiled. The error also shows up in the AppEngine version at:
http://gwtpsample.appspot.com/


[*] In development mode, I've noticed that AsyncProvider.get() seems
to be blocking: the code after the get() is only executed after the
call to onSuccess(). Is this the normal behaviour?

Peter Schmitt

unread,
Apr 9, 2010, 10:28:59 PM4/9/10
to googl...@googlegroups.com
Weird. Would you mind running your compile with the -gen option to see what Gin generates? You should be able to see your generated AsyncProvider in there and maybe we can spot any errors in that?


--
You received this message because you are subscribed to the Google Groups "google-gin" group.
To post to this group, send email to googl...@googlegroups.com.
To unsubscribe from this group, send email to google-gin+...@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/google-gin?hl=en.


Philippe Beaudoin

unread,
Apr 10, 2010, 12:52:09 AM4/10/10
to googl...@googlegroups.com
Really weird... I just tried compiling it on my home computer and it
worked. Maybe there's a difference in the GWT version I'm using here
and at work. (I'm with 2.0.3 here.) I'll check this out Monday and
come back to you.

Philippe Beaudoin

unread,
Apr 10, 2010, 1:39:45 AM4/10/10
to googl...@googlegroups.com
Hmmm... Stranger and stranger. Hoping my problem was solved, I
deployed to AppEngine, but then this version failed. So I recompiled
locally and it failed with the exact same error as before.

I'm not quite sure which -gen file you're talking about, but here's
what I think could be relevant:
AsyncLoader1*.java: http://pastebin.com/b1tfWD9m
AsyncLoader2*.java: http://pastebin.com/7Jh5Rqvv
MyGinjectorImpl.java: http://pastebin.com/cyamcuKg

They look pretty good to me, although I'm not quite sure what all
those $ signs do in java... Any other -gen file you'd like to see?

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. (Maybe it's just flakyness
too...)

Cheers,

Philippe

Peter Schmitt

unread,
Apr 12, 2010, 5:35:44 PM4/12/10
to googl...@googlegroups.com, fazal...@gmail.com
I couldn't detect any issues in the code. No idea why the error occurs. 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? I'd ask on the GWT list.

[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

PhilBeaudoin

unread,
Apr 12, 2010, 6:03:01 PM4/12/10
to google-gin
Just did. For cross-reference if anybody is interested in this, it's
here:
http://groups.google.com/group/google-web-toolkit/browse_thread/thread/7965e808ca80fbc6

On Apr 12, 2:35 pm, Peter Schmitt <ara...@gmail.com> wrote:
> I couldn't detect any issues in the code. No idea why the error occurs. 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? I'd ask on the GWT list.
>

> [1]http://www.google.com/codesearch/p?hl=en#MTQ26449crI/com/google/gwt/e...

> > >> On Fri, Apr 9, 2010 at 12:42, PhilBeaudoin <philippe.beaud...@gmail.com

> > >>> google-gin+...@googlegroups.com<google-gin%2Bunsubscribe@googlegrou ps.com>


> > .
> > >>> For more options, visit this group at
> > >>>http://groups.google.com/group/google-gin?hl=en.
>
> > >> --
> > >> You received this message because you are subscribed to the Google
> > Groups
> > >> "google-gin" group.
> > >> To post to this group, send email to googl...@googlegroups.com.
> > >> To unsubscribe from this group, send email to

> > >> google-gin+...@googlegroups.com<google-gin%2Bunsubscribe@googlegrou ps.com>


> > .
> > >> For more options, visit this group at
> > >>http://groups.google.com/group/google-gin?hl=en.
>
> > --
> > You received this message because you are subscribed to the Google Groups
> > "google-gin" group.
> > To post to this group, send email to googl...@googlegroups.com.
> > To unsubscribe from this group, send email to

> > google-gin+...@googlegroups.com<google-gin%2Bunsubscribe@googlegrou ps.com>

Reply all
Reply to author
Forward
0 new messages