Deferred binding failed

2019-02-19 09:14发布

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)

4条回答
贼婆χ
2楼-- · 2019-02-19 09:24

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

<inherits name="com.google.gwt.inject.Inject"/>
查看更多
放荡不羁爱自由
3楼-- · 2019-02-19 09:25

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)

查看更多
趁早两清
4楼-- · 2019-02-19 09:28

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

  • javax.inject.jar
  • guice-assistedinject-3.0.jar
  • aopalliance.jar
查看更多
ら.Afraid
5楼-- · 2019-02-19 09:37

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.

查看更多
登录 后发表回答