Gwt 2.2, guice and gin...

697 views
Skip to first unread message

Carlo Alberto Degli Atti

unread,
Feb 14, 2011, 10:57:01 AM2/14/11
to google-we...@googlegroups.com
Hello everybody,

 this morning I had the (bad) idea to update my eclipse environment to use gwt 2.2... (with 2.1 everything was fine)...

 now I'm experiencing a lot of problems... maybe it's my fault (I'm a new gwt & related techs user)...

 My application is using gin and guice; before this morning I was using gin v1.0 and guice 2.0.

 Now:

 1. after upgrading to gwt (to 2.2) I got this exception (still the original guice and gin versions):

[WARN] failed JettyContainerService$ApiProxyHandler@ae281c: java.lang.NoClassDefFoundError: com/google/inject/internal/Lists

[WARN] Error starting handlers

java.lang.NoClassDefFoundError: com/google/inject/internal/Lists

at com.google.inject.servlet.FiltersModuleBuilder.<init>(FiltersModuleBuilder.java:36)

at com.google.inject.servlet.ServletModule.<init>(ServletModule.java:219)

2. then I updated the guice version to 3.0-rc2 *mantaining* the original gin version (1.0), but I got this unlikely mix:

    gin-1.0.jar

    guice-2.0.jar

    guice-servlet-3.0-rc2.jar


   as expected, my application threw this exception:

   [WARN] Error starting handlers

   java.lang.NoClassDefFoundError: com/google/inject/internal/util/$Preconditions

at com.google.inject.servlet.ServletModule.configure(ServletModule.java:44)

at com.google.inject.AbstractModule.configure(AbstractModule.java:59)

        ...


 3. after some investigations, I discovered that gwt 3.2 requires a new gin (see this post http://groups.google.com/group/google-gin/browse_thread/thread/70520a9f495f5747/7930eda17843aea8#7930eda17843aea8 ). I also updated gin to 1.1-2.2-SNAPSHOT. The dependencies looked right now:


    gin-1.1-2.2-20110211.140818-5.jar

    guice-3.0-rc2.jar

    guice-assistedinject-3.0-rc2.jar

    guice-servlet-3.0-rc2.jar

    gwt-servlet-2.2.0.jar

    javax.inject-1.jar


  *BUT* the application threw another exception:


  com.google.inject.CreationException: Guice creation errors:


  1) No implementation for javax.inject.Provider<com.google.gwt.inject.rebind.GinjectorBindings> was bound.

     while locating javax.inject.Provider<com.google.gwt.inject.rebind.GinjectorBinding>

     for parameter 4 at com.google.gwt.inject.rebind.GinjectorBindings.<init>(GinjectorBindings.java:182)

     at com.google.gwt.inject.rebind.GinjectorGeneratorModule.configure(GinjectorGeneratorModule.java:69)


  So:

  - where am I wrong?

  - do you have suggestions to solve this?


  Thanks in advance for any help


  CA




    


Thomas Broyer

unread,
Feb 14, 2011, 11:06:19 AM2/14/11
to google-we...@googlegroups.com
GWT 2.2 introduces a binary incompatibility in generators (some classes have been replaced with interfaces), hence the error with GIN (though honestly, it should have been another error thatn the one you pasted here)

It is still source compatible with the previous versions though, so recompiling the generators (GIN in this case) is enough. 

Technically, you don't have to upgrade GIN to a 1.1-SNAPSHOT version if you don't want to, but you then have to recompile it against the GWT 2.2 SDK.
I'm not aware of any "GIN 1.0 recompiled for GWT 2.2" available for download though, so given that GIN 1.1 is compatible with GIN 1.0 (unless you're doing "hardcore" things with it), you can safely use a GIN 1.1-SNAPSHOT if you don't want to recompile GIN by yourself.

Christian Goudreau

unread,
Feb 14, 2011, 11:24:23 AM2/14/11
to google-we...@googlegroups.com
Thanks Thomas !

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



--
Christian Goudreau

Carlo Alberto Degli Atti

unread,
Feb 14, 2011, 12:12:23 PM2/14/11
to google-we...@googlegroups.com
Thomas

 thanks for your answer...

 when you say " but you then have to recompile it against the GWT 2.2 SDK", you mean I have to take the sources and repackage or simply start a gwt compilation?

 This error is generated by that or am I missing something else?
 
 No implementation for javax.inject.Provider<com.google.gwt.inject.rebind.GinjectorBindings> was bound.

  while locating javax.inject.Provider<com.google.gwt.inject.rebind.GinjectorBindings>

    for parameter 4 at com.google.gwt.inject.rebind.GinjectorBindings.<init>(GinjectorBindings.java:182)

  at com.google.gwt.inject.rebind.GinjectorGeneratorModule.configure(GinjectorGeneratorModule.java:69)


 Thanks thanks thanks


 ;-)

Thomas Broyer

unread,
Feb 14, 2011, 12:36:22 PM2/14/11
to google-we...@googlegroups.com


On Monday, February 14, 2011 6:12:23 PM UTC+1, Carlo Alberto Degli Atti wrote:
Thomas

 thanks for your answer...

 when you say " but you then have to recompile it against the GWT 2.2 SDK", you mean I have to take the sources and repackage or simply start a gwt compilation?

I meant repackage GIN from sources.
But actually I was a bit wrong about "source compatibility" (the issue is in GIN's side though): GIN uses GWT internals (including those modified classes), so it's not source compatible with "any version" of GWT.

leszek

unread,
Feb 14, 2011, 4:30:59 PM2/14/11
to Google Web Toolkit
I run into the same problem yesterday but finally, after taking new
GIN snapshot and migrate to GUICE 3.0 (as is described in your post) I
was successful and everything seems working now. The only problem I
spent several hours on was that Nullable annotation disappeared from
Guice internals and it took me a lot of time until I understood what
was going on.

http://groups.google.com/group/google-guice/browse_frm/thread/38859fab8f8aaa0a

You have to be prepared for a lot of surprises if you bank on google
code, is it bad news, but good news is that - on the whole - it works.


On 14 Lut, 16:57, Carlo Alberto Degli Atti <lordk...@gmail.com> wrote:
> Hello everybody,
>
>  this morning I had the (bad) idea to update my eclipse environment to use
> gwt 2.2... (with 2.1 everything was fine)...
>
>  now I'm experiencing a lot of problems... maybe it's my fault (I'm a new
> gwt & related techs user)...
>
>  My application is using gin and guice; before this morning I was using gin
> v1.0 and guice 2.0.
>
>  Now:
>
>  *1. after upgrading to gwt (to 2.2) I got this exception (still the
> original guice and gin versions):*
>
>    [WARN] failed JettyContainerService$ApiProxyHandler@ae281c:
> java.lang.NoClassDefFoundError: com/google/inject/internal/Lists
>
> [WARN] Error starting handlers
>
> java.lang.NoClassDefFoundError: com/google/inject/internal/Lists
>
> at com.google.inject.servlet.FiltersModuleBuilder.<init>(
> FiltersModuleBuilder.java:36)
>
> at com.google.inject.servlet.ServletModule.<init>(ServletModule.java:219)
>
> * 2. then I updated the guice version to 3.0-rc2 *mantaining* the original
> gin version (1.0), but I got this unlikely mix*:
>
>     gin-1.0.jar
>
>     guice-2.0.jar
>
>     guice-servlet-3.0-rc2.jar
>
>    as expected, my application threw this exception:
>
>    [WARN] Error starting handlers
>
>    java.lang.NoClassDefFoundError:
> com/google/inject/internal/util/$Preconditions
>
> at com.google.inject.servlet.ServletModule.configure(ServletModule.java:44)
>
> at com.google.inject.AbstractModule.configure(AbstractModule.java:59)
>
>         ...
>
>  *3. after some investigations, I discovered that gwt 3.2 requires a new gin
> (see this post **http://groups.google.com/group/google-gin/browse_thread/thread/70520a...
> ). **I also updated gin to 1.1-2.2-SNAPSHOT. *The dependencies looked right
> now:
>
>     gin-1.1-2.2-20110211.140818-5.jar
>
>     guice-3.0-rc2.jar
>
>     guice-assistedinject-3.0-rc2.jar
>
>     guice-servlet-3.0-rc2.jar
>
>     gwt-servlet-2.2.0.jar
>
>     javax.inject-1.jar
>
>   **BUT* the application threw another exception:*
>
>   com.google.inject.CreationException: Guice creation errors:
>
>   1) No implementation for
> javax.inject.Provider<com.google.gwt.inject.rebind.GinjectorBindings> was
> bound.
>
>      while locating
> javax.inject.Provider<com.google.gwt.inject.rebind.GinjectorBinding>
>
>      for parameter 4 at
> com.google.gwt.inject.rebind.GinjectorBindings.<init>(GinjectorBindings.jav a:182)
>
>      at
> com.google.gwt.inject.rebind.GinjectorGeneratorModule.configure(GinjectorGe neratorModule.java:69)

Carlo Alberto Degli Atti

unread,
Feb 15, 2011, 3:25:11 AM2/15/11
to Google Web Toolkit
thanks leszek,

but I'm experiencing this exception

No implementation for
javax.inject.Provider<com.google.gwt.inject.rebind.GinjectorBindings>
was
bound.
while locating
javax.inject.Provider<com.google.gwt.inject.rebind.GinjectorBindings>
for parameter 4
at
com.google.gwt.inject.rebind.GinjectorBindings.<init>(GinjectorBindings.java:
182)
at
com.google.gwt.inject.rebind.GinjectorGeneratorModule.configure(GinjectorGeneratorModule.java:
69)

Do you know what does it mean?
Is something missing?

Thanks a lot!


On Feb 14, 10:30 pm, leszek <leszek.ptokar...@gmail.com> wrote:
> I run into the same problem yesterday but finally, after taking new
> GIN snapshot and migrate to GUICE 3.0 (as is described in your post) I
> was successful and everything seems working now. The only problem I
> spent several hours on was that Nullable annotation disappeared from
> Guice internals and it took me a lot of time until I understood what
> was going on.
>
> http://groups.google.com/group/google-guice/browse_frm/thread/38859fa...

Avanish Raju

unread,
Dec 23, 2012, 8:01:52 AM12/23/12
to google-we...@googlegroups.com
Please help me. I've still not been able to resolve this. 

At least, any pointers as to why this might be happening? I tried to search online, but this thread is the only reference to this issue that I found. I've even tried to build guice from svn head, and added gin- and gin-src- jars to my project. I still get the same error about:

 No implementation for javax.inject.Provider<com.google.gwt.inject.rebind.GinjectorBindings> was bound. 

Also, currently, I'm only using GIN on client side, and haven't done any server-side Guice setup. Could this be the cause for my problem? In other words, will Gin only work if I'm also using guiceServlet configured?

Thanks, 
Avanish


On Sun, Dec 2, 2012 at 8:43 PM, Avanish Raju <yar...@gmail.com> wrote:
Hi Carlo, 

How did you fix this issue? I'm running into exactly the same problem. When I "Run as Web Application" on Eclipse, I get the following exception:

 No implementation for javax.inject.Provider<com.google.gwt.inject.rebind.GinjectorBindings> was bound. 
  while locating javax.inject.Provider<com.google.gwt.inject.rebind.GinjectorBindings> 
    for parameter 4 at com.google.gwt.inject.rebind.GinjectorBindings.<init>(GinjectorBindings.java:196) 
  at com.google.gwt.inject.rebind.GinjectorGeneratorModule.configure(GinjectorGeneratorModule.java:75) 

I've tried making a new project with the GIN source code, and adding that as a library to my Java project. But I still get the same error.

I'm using gin-2.0, which appears to come with guice-3.0 bundled with it.

Please let me know where I can look to troubleshoot this problem, or if there is some other library I should be including as well.

Regards, 
Avanish

--
You received this message because you are subscribed to the Google Groups "Google Web Toolkit" group.

To post to this group, send email to google-we...@googlegroups.com.
To unsubscribe from this group, send email to google-web-tool...@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/google-web-toolkit?hl=en.



--
"Life is what you make of it"
Y. Avanish Raju,

BTech, Computer Science and Engineering & Biotechnology,
ICFAI University, Dehradun

-----BEGIN GEEK CODE BLOCK-----
Version: 3.12
GCS/S/MU d- s:- a- C+++ UL+++ P+ L+++>++++ E-->--- W++>+++ N- o? K- w+>w++ !O !M !V
PS++@ PE++ Y+@ PGP- t 5? X+ R tv b+++ DI+@ D+ G e>++ h* r-- y
------END GEEK CODE BLOCK------

Goktug Gokdogan

unread,
Dec 26, 2012, 3:53:57 PM12/26/12
to google-web-toolkit
This may be related to depending on multiple versions of Guice.
As this is related to GIN, google-gin group is a better place to get support on this. There was even a recent question about it if you search there.

Good luck and don't forget to share with the rest what worked for you for future reference :)

On Sun, Dec 23, 2012 at 5:01 AM, Avanish Raju <yar...@gmail.com> wrote:
GinjectorBindings

Avanish Raju

unread,
Dec 27, 2012, 9:45:01 AM12/27/12
to google-we...@googlegroups.com, googl...@googlegroups.com
Hi Goktug!

(+google-gin for posterity)

Thanks for the reply! I dug deeper into this today, and nailed it. It was indeed a Classpath issue. In specific, the ordering. Perhaps one of the GWT/RequestFactory, or other libraries were overriding the javax.inject imports that are provided by GIN.

Here's the order that finally worked:
        aopalliance.jar
        gin-2.0.jar
        guice-3.0.jar
        guice-assistedinject-3.0.jar
        javax.inject.jar

I made the change in Eclipse: Project> Build Path > Configure Build Path > Order and Export. Select all of the above, and choose "Top", and then tick all of the JARS. Any other way, I would continue to get the error. (The only thing I didn't try is juggling around the order of these specific JARS)

One more issue I ran into, and Thomas(tbroyer) has already answered on StackOverflow:

I ran into this NPE, which happens because I was injecting the RequestFactory, and not running "initialize" on it. Solved by writing a Provider in my GinModule:

   @Provides
   @Singleton
   MyAppRequestFactory provideMyAppRequestFactory(EventBus eventBus) {
      MyAppRequestFactory requestFactory = GWT.create(MyAppRequestFactory.class);
      requestFactory.initialize(eventBus);
      return requestFactory;
   }

After that, it runs fine. :) Thanks once again!

Cheers, 
Avanish


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

Goktug Gokdogan

unread,
Dec 27, 2012, 3:25:19 PM12/27/12
to google-web-toolkit, googl...@googlegroups.com
It makes sense. I guess projects using maven are not seeing the problem because GIN itself is pulling in the Guice dependency which results in correct order.

This is very nice of you sharing it with the rest. Thanks!


Reply all
Reply to author
Forward
0 new messages