GWT错误:'com.google.gwt.widgetideas.client.FastTree $ DefaultResources'(你忘了继承一个必需的模块吗?)

时间:2011-10-04 14:58:41

标签: java gwt

我是GWT的新手并使用2.4版本。在我的EntryPoint课程中,我有这一行...

public void onModuleLoad() {
    FastTree.addDefaultCSS();

与以下例外无情地死亡。我正在通过Eclipse(Debug As - > Web Application)启动我的应用程序。下面是我的.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)

1 个答案:

答案 0 :(得分:2)

您正在使用与GWT 2.4不兼容的孵化器库(WidgetIdeas和LibIdeas)版本。在GWT的最新版本中,孵化器的大多数功能都已移至GWT本身,因此您甚至可能不需要该库。例如,您正在使用FastTree,它在GWT 2.4中以CellTree的形式提供。所以你应该使用CellTree。一般情况下,你不应该使用GWT孵化器,因为它没有维护。