2011-10-04 72 views
0

我是GWT新手,使用2.4版本。在我的入口點類中,我有這條線......

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) 

回答

2

您正在使用一個版本的孵化器庫(WidgetIdeas和LibIdeas)不是與GWT 2.4兼容的。在最近的GWT版本中,孵化器的大部分功能都已經轉移到GWT本身,因此您可能甚至不需要該庫。例如,您正在使用FastTree,它在GWT 2.4中可用爲CellTree。所以你應該使用CellTree。一般來說,你不應該使用GWT孵化器,因爲它不會被維護。

+0

謝謝2年後真的幫助我現在:) – YouYou