2

My application is throwing:

java.lang.RuntimeException: Deferred binding failed for 'com.mygwtapp.client.gin.ClientAppGinjector' (did you forget to inherit a required module?)

on this code inside the EntryPoint:

private final ClientAppGinjector injector = GWT.create(ClientAppGinjector.class);

What could be the problem?

Here's the full error Log:

java.lang.RuntimeException: Deferred binding failed for 'com.mygwtapp.client.gin.ClientAppGinjector' (did you forget to inherit a required module?)
    at com.google.gwt.dev.shell.GWTBridgeImpl.create(GWTBridgeImpl.java:53)
    at com.google.gwt.core.client.GWT.create(GWT.java:97)
    at com.mygwtapp.client.MainEntryPoint.<init>(MainEntryPoint.java:79)
    at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
    at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:57)
    at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45)
    at java.lang.reflect.Constructor.newInstance(Constructor.java:525)
    at com.google.gwt.dev.shell.ModuleSpace.rebindAndCreate(ModuleSpace.java:465)
    at com.google.gwt.dev.shell.ModuleSpace.onLoad(ModuleSpace.java:375)
    at com.google.gwt.dev.shell.OophmSessionHandler.loadModule(OophmSessionHandler.java:200)
    at com.google.gwt.dev.shell.BrowserChannelServer.processConnection(BrowserChannelServer.java:525)
    at com.google.gwt.dev.shell.BrowserChannelServer.run(BrowserChannelServer.java:363)
    at java.lang.Thread.run(Thread.java:722)
quarks
  • 33,478
  • 73
  • 290
  • 513

4 Answers4

6

I've had the same error message during runtime. When I tried "Google > GWT Compile" the stack trace helped me better. My problem was that the service interface used a class that wasn't serializable.

SamuraiCharlie
  • 184
  • 2
  • 4
1

In your ".gwt.xml" file, add the following line:

<inherits name="com.google.gwt.inject.Inject"/>
Chris Lercher
  • 37,264
  • 20
  • 99
  • 131
  • I have this inherit on the gwt.xml – quarks May 03 '12 at 00:10
  • @xybrek: Sure, there can be several reasons (I think you had a similar problem a while ago already http://stackoverflow.com/q/6555062/291741 ;-) I suggest trying if your setup works with the official [GIN samples](http://code.google.com/p/google-gin/source/browse/trunk/samples/) first. If not, then check the libraries (there is gin-1.5-post-gwt-2.2.jar and gin-1.5-pre-gwt-2.2.jar, make sure to use the right one). – Chris Lercher May 03 '12 at 00:30
  • Yah, but I need to use GWT 2.4.0, the Gin jars are from maven with version: 1.5.0 – quarks May 03 '12 at 00:43
  • I'm not sure how I can know whether which gin-1.5 jar is being fetched from maven – quarks May 03 '12 at 00:45
  • incompatibility with the gwt version will give issues about an abstract class that should be an interface (or vice versa) - the full error log should show that. Is there no error before that RuntimeException? – Colin Alworth May 03 '12 at 00:54
  • 1
    I manually added gin-1.5-post-gwt-2.2.jar, now I'm getting this error: com.google.gwt.core.ext.UnableToCompleteException: (see previous log entries) at com.google.gwt.dev.shell.ModuleSpace.rebindAndCreate(ModuleSpace.java:503) – quarks May 03 '12 at 01:08
  • Without the rest of the exception (note the part that says 'see previous log entries') that is not a useful error message. – Colin Alworth May 03 '12 at 03:31
1

I had the same problem, I resolved lom adding the following libraries:

  • javax.inject.jar
  • guice-assistedinject-3.0.jar
  • aopalliance.jar
-1

I had the same problem. My getter method of Boolean object called getBooleanObject() instead of isBooleanObject(). Class JsonEncoderDecoder looked for method called isBooleanObject(), didn't find him, compilation failed. (gwt 2.8.0)

FortyTwo
  • 2,414
  • 3
  • 22
  • 33