GWT:无法加载模块

GWT:无法加载模块,gwt,Gwt,我想用我自己的方式组织我的文件夹,但到目前为止还不起作用 这是我的目录结构 src com.tutorial.client 字典模块 com.tutorial.module Tutorial.gwt.xml Tutorial.gwt.xml: <module rename-to="tutorial"> <inherits name='com.google.gwt.user.User'/> <inherits name='com.google.gw

我想用我自己的方式组织我的文件夹,但到目前为止还不起作用

这是我的目录结构

src

  • com.tutorial.client
    • 字典模块
  • com.tutorial.module
    • Tutorial.gwt.xml
Tutorial.gwt.xml:

<module rename-to="tutorial">
  <inherits name='com.google.gwt.user.User'/>
  <inherits name='com.google.gwt.user.theme.standard.Standard'/>
  <entry-point class="com.tutorial.client.DictionaryModule"/>
</module>
但我得到了这个错误:

[错误]找不到类型 'com.tutorial.client.DictionaryModule' [错误]提示:以前的编译器错误 可能已使此类型不可用 [错误]提示:检查继承 链从您的模块;可能不是 继承所需的模块或 模块可能未添加其源 路径条目正确[错误]失败 加载模块“教程”


将gwt.xml放在包含客户端目录的目录中,并向其中添加以下内容:

   <source path="module" />
   <source path="client" />

将gwt.xml放在包含客户端目录的目录中,并向其中添加以下内容:

   <source path="module" />
   <source path="client" />

我知道你一定早就设法解决了这个问题,但对于其他人来说,我是这样解决的:

我有一个使用Hibernate框架的gwt项目,并使用Maven2进行构建管理

转到:项目>属性>Java构建路径>排序和导出。现在确保GWTSDK高于Maven和JRE/JDK库


原因是因为在多个库中有多个同名的类文件,编译器无法决定优先处理哪个类文件,因此我们必须通过指定顺序来控制这一点。

我知道您一定早就设法解决了这个问题,但对于其他库,我是这样解决的:

我有一个使用Hibernate框架的gwt项目,并使用Maven2进行构建管理

转到:项目>属性>Java构建路径>排序和导出。现在确保GWTSDK高于Maven和JRE/JDK库


原因是因为在多个库中有多个同名的类文件,编译器无法决定优先处理哪个类文件,所以我们必须通过指定顺序来控制它。

只需更改目录结构即可

 - com.tutorial.module.client

       DictionaryModule

 - com.tutorial.module

        Tutorial.gwt.xml
然后在
Tutorial.gwt.xml

<module rename-to="tutorial">
  <inherits name='com.google.gwt.user.User'/>
  <inherits name='com.google.gwt.user.theme.standard.Standard'/>
  <entry-point class="com.tutorial.module.client.DictionaryModule"/>
    <source path='client'/>
</module>

只需更改目录结构即可

 - com.tutorial.module.client

       DictionaryModule

 - com.tutorial.module

        Tutorial.gwt.xml
然后在
Tutorial.gwt.xml

<module rename-to="tutorial">
  <inherits name='com.google.gwt.user.User'/>
  <inherits name='com.google.gwt.user.theme.standard.Standard'/>
  <entry-point class="com.tutorial.module.client.DictionaryModule"/>
    <source path='client'/>
</module>


在所有答案中,这是唯一对我有效的答案。在所有答案中,这是唯一对我有效的答案