将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文件中的inherites模块
<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' />
提前感谢您的回答
答案 0 :(得分:0)
尝试添加
<inherits name="com.google.web.bindery.event.Event"/>
到你的主<project>.gwt.xml
它应该解决事件问题
还要尝试将gwt jar放在类路径中的gxt jar之前
并检查HasDirectionalSafeHtml
从HasSafeHtml
获取SafeHtml
和gwt-servlet-2.4.0.jar
,或检查您的类路径中是否存在gwt-servlet-2.4.0.jar
的事件。
这应解决HasDirectionalSafeHtml
个问题
答案 1 :(得分:0)
我已经解决了这个问题。
删除WEB-INF / lib中的所有jar,然后从APP Engine和其他
复制新jar有用的。然后它工作