GWT 错误:“com.google.gwt.widgetideas.client.FastTree$DefaultResources” (您是否忘记继承所需的模块?)

发布于 2024-12-08 06:03:09 字数 4526 浏览 0 评论 0原文

我是 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 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

只想待在家 2024-12-15 06:03:09

您使用的孵化器库版本(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 as CellTree. So you should use CellTree. In general you should not use the GWT incubator as it's not maintained.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文