更新 GWT 后构建 GWT 应用程序时出错
将 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 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
尝试添加
到您的主
.gwt.xml
它应该可以解决事件问题还尝试将 gwt jar 放在类路径中的 gxt jar 之前
,并检查
HasDirectionalSafeHtml
是否从gwt-servlet- 获取
,或事件检查类路径中是否存在HasSafeHtml
和SafeHtml
2.4.0.jargwt-servlet-2.4.0.jar
。这应该可以解决
HasDirectionalSafeHtml
问题Try to add
to your main
<project>.gwt.xml
it should solve Events problemsAlso try to place your gwt jars before gxt jars in your classpath
And check that
HasDirectionalSafeHtml
takeHasSafeHtml
andSafeHtml
fromgwt-servlet-2.4.0.jar
, or event check ifgwt-servlet-2.4.0.jar
exists in your classpath.This should solve
HasDirectionalSafeHtml
problems我已经解决了这个问题。
删除 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