Re: Gwt 2.2, guice and gin...

222 views
Skip to first unread message

Avanish Raju

unread,
Dec 27, 2012, 9:46:59 AM12/27/12
to googl...@googlegroups.com
(+google-gin for posterity)


On Thu, Dec 27, 2012 at 8:15 PM, Avanish Raju <yar...@gmail.com> wrote:
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


On Thu, Dec 27, 2012 at 2:23 AM, Goktug Gokdogan <gok...@google.com> wrote:
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

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



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