GWT 错误:“com.google.gwt.widgetideas.client.FastTree$DefaultResources” (您是否忘记继承所需的模块?)
我是 GWT 新手,使用的是 2.4 版本。在我的 EntryPoint 类中,我有这一行...
public void onModuleLoad() {
FastTree.addDefaultCSS();
它正在无情地死去,但有以下例外。我正在通过 Eclipse 启动我的应用程序(调试为 -> Web 应用程序)。下面是我的 .gwt.xml 文件...
<?xml version="1.0" encoding="UTF-8"?>
<module rename-to='sampletreeapp'>
<inherits name='com.google.gwt.user.User'/>
<!-- Inherit the default GWT style sheet. You can change -->
<!-- the theme of your GWT application by uncommenting -->
<!-- any one of the following lines. -->
<inherits name='com.google.gwt.user.theme.clean.Clean'/>
<!-- Other module inherits -->
<!-- Specify the app entry point class. -->
<entry-point class='com.google.gwt.sample.sampletreeapp.client.SampleTreeApp'/>
<!-- Specify the paths for translatable code -->
<source path='client'/>
<source path='shared'/>
<inherits name='com.google.gwt.widgetideas.WidgetIdeas' />
<inherits name='com.google.gwt.libideas.LibIdeas' />
</module>
有什么想法可以治愈痛苦吗? - 戴夫
java.lang.RuntimeException: Deferred binding failed for 'com.google.gwt.widgetideas.client.FastTree$DefaultResources' (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.google.gwt.widgetideas.client.FastTree$DefaultResources.<clinit>(FastTree.java:66)
at com.google.gwt.widgetideas.client.FastTree.addDefaultCSS(FastTree.java:100)
at com.google.gwt.sample.sampletreeapp.client.SampleTreeApp.onModuleLoad(SampleTreeApp.java:38)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
at java.lang.reflect.Method.invoke(Unknown Source)
at com.google.gwt.dev.shell.ModuleSpace.onLoad(ModuleSpace.java:396)
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(Unknown Source)
Caused by: java.lang.IncompatibleClassChangeError: Found interface com.google.gwt.core.ext.typeinfo.JClassType, but class was expected
at com.google.gwt.libideas.resources.rebind.AbstractResourceBundleGenerator.generate(Unknown Source)
at com.google.gwt.core.ext.GeneratorExtWrapper.generate(GeneratorExtWrapper.java:48)
at com.google.gwt.core.ext.GeneratorExtWrapper.generateIncrementally(GeneratorExtWrapper.java:60)
at com.google.gwt.dev.javac.StandardGeneratorContext.runGeneratorIncrementally(StandardGeneratorContext.java:647)
at com.google.gwt.dev.cfg.RuleGenerateWith.realize(RuleGenerateWith.java:41)
at com.google.gwt.dev.shell.StandardRebindOracle$Rebinder.rebind(StandardRebindOracle.java:78)
at com.google.gwt.dev.shell.StandardRebindOracle.rebind(StandardRebindOracle.java:268)
at com.google.gwt.dev.shell.ShellModuleSpaceHost.rebind(ShellModuleSpaceHost.java:141)
at com.google.gwt.dev.shell.ModuleSpace.rebind(ModuleSpace.java:585)
at com.google.gwt.dev.shell.ModuleSpace.rebindAndCreate(ModuleSpace.java:455)
at com.google.gwt.dev.shell.GWTBridgeImpl.create(GWTBridgeImpl.java:49)
at com.google.gwt.core.client.GWT.create(GWT.java:97)
at com.google.gwt.widgetideas.client.FastTree$DefaultResources.<clinit>(FastTree.java:66)
at com.google.gwt.widgetideas.client.FastTree.addDefaultCSS(FastTree.java:100)
at com.google.gwt.sample.sampletreeapp.client.SampleTreeApp.onModuleLoad(SampleTreeApp.java:38)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
at java.lang.reflect.Method.invoke(Unknown Source)
at com.google.gwt.dev.shell.ModuleSpace.onLoad(ModuleSpace.java:396)
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(Unknown Source)
I'm new to GWT and using version 2.4. In my EntryPoint class, I have this line ...
public void onModuleLoad() {
FastTree.addDefaultCSS();
which is dying mercilessly with the below exception. I'm launching my application through Eclipse (Debug As -> Web Application). Below is my .gwt.xml file ...
<?xml version="1.0" encoding="UTF-8"?>
<module rename-to='sampletreeapp'>
<inherits name='com.google.gwt.user.User'/>
<!-- Inherit the default GWT style sheet. You can change -->
<!-- the theme of your GWT application by uncommenting -->
<!-- any one of the following lines. -->
<inherits name='com.google.gwt.user.theme.clean.Clean'/>
<!-- Other module inherits -->
<!-- Specify the app entry point class. -->
<entry-point class='com.google.gwt.sample.sampletreeapp.client.SampleTreeApp'/>
<!-- Specify the paths for translatable code -->
<source path='client'/>
<source path='shared'/>
<inherits name='com.google.gwt.widgetideas.WidgetIdeas' />
<inherits name='com.google.gwt.libideas.LibIdeas' />
</module>
Any ideas how to heal the pain? - Dave
java.lang.RuntimeException: Deferred binding failed for 'com.google.gwt.widgetideas.client.FastTree$DefaultResources' (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.google.gwt.widgetideas.client.FastTree$DefaultResources.<clinit>(FastTree.java:66)
at com.google.gwt.widgetideas.client.FastTree.addDefaultCSS(FastTree.java:100)
at com.google.gwt.sample.sampletreeapp.client.SampleTreeApp.onModuleLoad(SampleTreeApp.java:38)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
at java.lang.reflect.Method.invoke(Unknown Source)
at com.google.gwt.dev.shell.ModuleSpace.onLoad(ModuleSpace.java:396)
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(Unknown Source)
Caused by: java.lang.IncompatibleClassChangeError: Found interface com.google.gwt.core.ext.typeinfo.JClassType, but class was expected
at com.google.gwt.libideas.resources.rebind.AbstractResourceBundleGenerator.generate(Unknown Source)
at com.google.gwt.core.ext.GeneratorExtWrapper.generate(GeneratorExtWrapper.java:48)
at com.google.gwt.core.ext.GeneratorExtWrapper.generateIncrementally(GeneratorExtWrapper.java:60)
at com.google.gwt.dev.javac.StandardGeneratorContext.runGeneratorIncrementally(StandardGeneratorContext.java:647)
at com.google.gwt.dev.cfg.RuleGenerateWith.realize(RuleGenerateWith.java:41)
at com.google.gwt.dev.shell.StandardRebindOracle$Rebinder.rebind(StandardRebindOracle.java:78)
at com.google.gwt.dev.shell.StandardRebindOracle.rebind(StandardRebindOracle.java:268)
at com.google.gwt.dev.shell.ShellModuleSpaceHost.rebind(ShellModuleSpaceHost.java:141)
at com.google.gwt.dev.shell.ModuleSpace.rebind(ModuleSpace.java:585)
at com.google.gwt.dev.shell.ModuleSpace.rebindAndCreate(ModuleSpace.java:455)
at com.google.gwt.dev.shell.GWTBridgeImpl.create(GWTBridgeImpl.java:49)
at com.google.gwt.core.client.GWT.create(GWT.java:97)
at com.google.gwt.widgetideas.client.FastTree$DefaultResources.<clinit>(FastTree.java:66)
at com.google.gwt.widgetideas.client.FastTree.addDefaultCSS(FastTree.java:100)
at com.google.gwt.sample.sampletreeapp.client.SampleTreeApp.onModuleLoad(SampleTreeApp.java:38)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
at java.lang.reflect.Method.invoke(Unknown Source)
at com.google.gwt.dev.shell.ModuleSpace.onLoad(ModuleSpace.java:396)
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(Unknown Source)
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
您使用的孵化器库版本(WidgetIdeas 和 LibIdeas)与 GWT 2.4 不兼容。在 GWT 的最新版本中,孵化器中的大部分功能已移至 GWT 本身,因此您甚至可能不需要该库。例如,您正在使用
FastTree
,它在 GWT 2.4 中作为CellTree
提供。所以你应该使用CellTree
。一般来说,您不应该使用 GWT 孵化器,因为它没有维护。You're using a version of the incubator library (WidgetIdeas and LibIdeas) that is not compatible with GWT 2.4. In recent versions of GWT most of the features from the incubator have been moved to GWT itself, so you might not even need the library. For example you're using
FastTree
, which is available in GWT 2.4 asCellTree
. So you should useCellTree
. In general you should not use the GWT incubator as it's not maintained.