更新GWT后生成GWT应用程序时出错

更新GWT后生成GWT应用程序时出错,gwt,ant,build,Gwt,Ant,Build,将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/Ha

将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' />
提前感谢您的回答

请尝试添加

<inherits name="com.google.web.bindery.event.Event"/>
对于main.gwt.xml,它应该可以解决事件问题 在类路径中,还要尝试将gwt JAR放在gxt JAR之前

并检查HasDirectionalSafeHtml是否从gwt-servlet-2.4.0.jar中获取HasSafeHtml和SafeHtml,或者检查类路径中是否存在gwt-servlet-2.4.0.jar


这应该可以解决HasDirectionalSafeHtml问题

我已经解决了这个问题

删除WEB-INF/lib中的所有jar,然后从APP Engine和其他应用程序复制新的jar


有用的。那就行了

谢谢你的回复,我已经试过你说的方法了,但还是一样的。有人告诉我什么问题与环境有关,我会试试其他的。我发现了类似的问题。