更新 GWT 后构建 GWT 应用程序时出错

发布于 2025-01-06 01:05:56 字数 2983 浏览 1 评论 0原文

将 GWT2.0 更新到 GWT2.4 后,eclipse 在使用 ant 构建 GWT 应用程序时显示错误消息。 这是消息:

[java] Compiling module com.certus.noc.noc
 [java]    Validating newly compiled units
 [java]       [ERROR] Errors in 'jar:file:/D:/EX-GWT/gwt-2.4.0/gwt-user.jar!/com/google/gwt/user/client/ui/HasDirectionalSafeHtml.java'
 [java]          [ERROR] Line 26: No source code is available for type com.google.gwt.safehtml.client.HasSafeHtml; did you forget to inherit a required module?
 [java]          [ERROR] Line 33: No source code is available for type com.google.gwt.safehtml.shared.SafeHtml; did you forget to inherit a required module?
 [java]       [ERROR] Errors in 'jar:file:/D:/EX-GWT/gwt-2.4.0/gwt-user.jar!/com/google/gwt/event/shared/SimpleEventBus.java'
 [java]          [ERROR] Line 27: No source code is available for type com.google.web.bindery.event.shared.SimpleEventBus; did you forget to inherit a required module?
 [java]          [ERROR] Line 32: Cannot cast from GwtEvent.Type<H> to Event.Type<H>
 [java]          [ERROR] Line 32: No source code is available for type com.google.web.bindery.event.shared.Event<H>.Type<H>; did you forget to inherit a required module?
 [java]          [ERROR] Line 36: No source code is available for type com.google.web.bindery.event.shared.HandlerRegistration; did you forget to inherit a required module?
 [java]          [ERROR] Line 42: Cannot cast from GwtEvent.Type<H> to Event.Type<H>
 [java]          [ERROR] Line 51: No source code is available for type com.google.web.bindery.event.shared.Event<H>; did you forget to inherit a required module?
 [java]       [ERROR] Errors in 'jar:file:/D:/EX-GWT/gwt-2.4.0/gwt-user.jar!/com/google/gwt/user/client/ui/DirectionalTextHelper.java'
 [java]          [ERROR] Line 32: No source code is available for type com.google.gwt.i18n.shared.HasDirectionEstimator; did you forget to inherit a required module?

以及 gwt.xml 文件中的继承模块

<inherits name='com.google.gwt.user.User'/>
<inherits name='com.extjs.gxt.ui.GXT'/>
<inherits name='com.extjs.gxt.desktop.WebDesktop' />
<inherits name='com.certus.noc.resources.Resources' />
<!-- 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.certus.noc.resources.Resources' />
<inherits name='com.google.gwt.user.theme.standard.Standard'/>
<!-- <inherits name='com.google.gwt.user.theme.chrome.Chrome'/> -->
<!-- <inherits name='com.google.gwt.user.theme.dark.Dark'/>     -->

<!-- Other module inherits                                      -->
<inherits name='com.extjs.gxt.themes.Themes' />

<inherits name='com.google.gwt.i18n.I18N' />
<inherits name='com.extjs.gxt.charts.Chart' />

提前感谢您的任何回答

after updating GWT2.0 to the GWT2.4, eclipse shows error message when building GWT app with ant.
here is the message:

[java] Compiling module com.certus.noc.noc
 [java]    Validating newly compiled units
 [java]       [ERROR] Errors in 'jar:file:/D:/EX-GWT/gwt-2.4.0/gwt-user.jar!/com/google/gwt/user/client/ui/HasDirectionalSafeHtml.java'
 [java]          [ERROR] Line 26: No source code is available for type com.google.gwt.safehtml.client.HasSafeHtml; did you forget to inherit a required module?
 [java]          [ERROR] Line 33: No source code is available for type com.google.gwt.safehtml.shared.SafeHtml; did you forget to inherit a required module?
 [java]       [ERROR] Errors in 'jar:file:/D:/EX-GWT/gwt-2.4.0/gwt-user.jar!/com/google/gwt/event/shared/SimpleEventBus.java'
 [java]          [ERROR] Line 27: No source code is available for type com.google.web.bindery.event.shared.SimpleEventBus; did you forget to inherit a required module?
 [java]          [ERROR] Line 32: Cannot cast from GwtEvent.Type<H> to Event.Type<H>
 [java]          [ERROR] Line 32: No source code is available for type com.google.web.bindery.event.shared.Event<H>.Type<H>; did you forget to inherit a required module?
 [java]          [ERROR] Line 36: No source code is available for type com.google.web.bindery.event.shared.HandlerRegistration; did you forget to inherit a required module?
 [java]          [ERROR] Line 42: Cannot cast from GwtEvent.Type<H> to Event.Type<H>
 [java]          [ERROR] Line 51: No source code is available for type com.google.web.bindery.event.shared.Event<H>; did you forget to inherit a required module?
 [java]       [ERROR] Errors in 'jar:file:/D:/EX-GWT/gwt-2.4.0/gwt-user.jar!/com/google/gwt/user/client/ui/DirectionalTextHelper.java'
 [java]          [ERROR] Line 32: No source code is available for type com.google.gwt.i18n.shared.HasDirectionEstimator; did you forget to inherit a required module?

and the inherites module in gwt.xml file

<inherits name='com.google.gwt.user.User'/>
<inherits name='com.extjs.gxt.ui.GXT'/>
<inherits name='com.extjs.gxt.desktop.WebDesktop' />
<inherits name='com.certus.noc.resources.Resources' />
<!-- 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.certus.noc.resources.Resources' />
<inherits name='com.google.gwt.user.theme.standard.Standard'/>
<!-- <inherits name='com.google.gwt.user.theme.chrome.Chrome'/> -->
<!-- <inherits name='com.google.gwt.user.theme.dark.Dark'/>     -->

<!-- Other module inherits                                      -->
<inherits name='com.extjs.gxt.themes.Themes' />

<inherits name='com.google.gwt.i18n.I18N' />
<inherits name='com.extjs.gxt.charts.Chart' />

Thanks in advance for any answer

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

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

发布评论

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

评论(2

吖咩 2025-01-13 01:05:57

尝试添加

<inherits name="com.google.web.bindery.event.Event"/>

到您的主 .gwt.xml 它应该可以解决事件问题
还尝试将 gwt jar 放在类路径中的 gxt jar 之前

,并检查 HasDirectionalSafeHtml 是否从 gwt-servlet- 获取 HasSafeHtmlSafeHtml 2.4.0.jar,或事件检查类路径中是否存在 gwt-servlet-2.4.0.jar

这应该可以解决 HasDirectionalSafeHtml 问题

Try to add

<inherits name="com.google.web.bindery.event.Event"/>

to your main <project>.gwt.xml it should solve Events problems
Also try to place your gwt jars before gxt jars in your classpath

And check that HasDirectionalSafeHtml take HasSafeHtml and SafeHtml from gwt-servlet-2.4.0.jar, or event check if gwt-servlet-2.4.0.jar exists in your classpath.

This should solve HasDirectionalSafeHtml problems

穿透光 2025-01-13 01:05:57

我已经解决了这个问题。

删除 WEB-INF/lib 中的所有 jar,然后从 APP Engine 和其他

有用的 .然后就可以了

I have solved the problem.

delete all the jars in the WEB-INF/lib, and then copy the new jar from APP Engine and other

userful . then it works

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