本文介绍了延期绑定失败的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我的应用程序正在抛出:

My application is throwing:

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

ClientAppGinjector inject = GWT.create(ClientAppGinjector.class);

on this code inside the EntryPoint:

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

可能是什么问题?

以下是完整的错误日志:

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)


推荐答案

在您的.gwt.xml文件中,添加以下行:

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

<inherits name="com.google.gwt.inject.Inject"/>

这篇关于延期绑定失败的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

10-10 20:45