使用GXT 3.1.0编译GWT项目(GWT2.6.0)时出现错误



我使用GWT 2.6.0创建了一个项目,它编译和运行没有任何问题,但当我将gxt.jar(3.1.0版)添加到构建路径并再次编译时,它出现了以下错误。

Loading inherited module 'com.drishti.ameyo.ic.Com_drishti_ameyo_ic'
   Loading inherited module 'com.sencha.gxt.ui.GXT'
      Loading inherited module 'com.sencha.gxt.data.Data'
         Loading inherited module 'com.sencha.gxt.core.Core'
            [ERROR] Line 49: Unexpected exception while processing element 'property-provider'
com.google.gwt.dev.jjs.InternalCompilerException: Unexpected error during visit.
    at com.google.gwt.dev.js.ast.JsVisitor.translateException(JsVisitor.java:483)
    at com.google.gwt.dev.js.ast.JsVisitor.doTraverse(JsVisitor.java:470)
    at com.google.gwt.dev.js.ast.JsVisitor.doAccept(JsVisitor.java:445)
    at com.google.gwt.dev.js.ast.JsVisitor.accept(JsVisitor.java:109)
    at com.google.gwt.dev.js.JsToStringGenerationVisitor.visit(JsToStringGenerationVisitor.java:550)
    at com.google.gwt.dev.js.ast.JsInvocation.traverse(JsInvocation.java:69)
    at com.google.gwt.dev.js.ast.JsVisitor.doTraverse(JsVisitor.java:468)
    at com.google.gwt.dev.js.ast.JsVisitor.doAccept(JsVisitor.java:445)

这是我遵循的说明链接http://docs.sencha.com/gxt/3.1/getting_started/Getting_Started_Eclipse_Standard.html#Build_path

下面是我继承com.sencha.gxt.ui.GXT 后的gwt.xml文件

<?xml version="1.0" encoding="UTF-8"?>
<!--
  When updating your version of GWT, you should also update this DTD reference,
  so that your app can take advantage of the latest GWT module capabilities.
-->
<module rename-to='com_drishti_ameyo_ic'>
  <!-- Inherit the core Web Toolkit stuff.                        -->
  <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.standard.Standard'/>
  <inherits name='com.drishti.ameyo.media.dim.app.agentAvailabiltyStatusApp'/>
  <inherits name='com.sencha.gxt.ui.GXT'/>
  <!-- <inherits name='com.google.gwt.user.theme.chrome.Chrome'/> -->
  <!-- <inherits name='com.google.gwt.user.theme.dark.Dark'/>     -->
  <!-- Other module inherits                                      -->
    <!-- GXT Stylesheet -->
        <stylesheet src="reset.css" />
  <!-- Specify the app entry point class.            -->
  <entry-point class='com.drishti.ameyo.ic.client.InteractionCampaign'/>
  <!-- Specify the paths for translatable code                    -->
  <source path=''/>
  <set-property name="user.agent" value="gecko1_8" /> 
  <!-- allow Super Dev Mode -->
  <add-linker name="xsiframe"/>
</module>

关于模块描述符的一些要点:

  • 删除以下条目:
    <inherits name='com.google.gwt.user.theme.standard.Standard'/>

只要您只使用GXT小部件,就不需要它们。

  • 添加GXT主题:f.e.:<inherits name='com.sencha.gxt.theme.neptune.Theme'/>确保将neptune主题jar添加到类路径中

  • 在代码中使用客户端共享和服务器包。使用<source path=''/>让GWT搜索整个项目。

对于您的问题(如上所述):
我可以确认:GWT2.6.0和GXT3.1将会工作。

最新更新