【问题标题】:Gwt compiling error: unable to find typeGwt编译错误:找不到类型
【发布时间】:2013-04-03 10:50:44
【问题描述】:

我在编译我的应用时出错:

[INFO] Compiling module com.messagedna.web.Main
[INFO]    Finding entry point classes
[INFO]       [ERROR] Unable to find type 'com.messagedna.web.client.controller.Main'
[INFO]          [ERROR] Hint: Previous compiler errors may have made this type unavailable
[INFO]          [ERROR] Hint: Check the inheritance chain from your module; it may not be inheriting a required module or a module may not be adding its source path entries properly

我试图在谷歌中找到解决方案,但没有找到任何解决方案。 这是我的 gwt.xml 文件:

    <!DOCTYPE module PUBLIC "-//Google Inc.//DTD Google Web Toolkit 1.6//EN"
        "http://google-web-toolkit.googlecode.com/svn/releases/1.6/distro-source/core/src/gwt-module.dtd">
<module>

    <inherits name='com.extjs.gxt.ui.GXT'/>

    <inherits name="com.extjs.gxt.charts.Chart"/>

    <entry-point class='com.messagedna.web.client.controller.Main'/>

    <source path="com.messagedna"></source>


</module>

【问题讨论】:

  • 我当然有这门课。好吧,所有必要的类都在 com.messagedna.web.client 包中。我用想法

标签: java gwt maven


【解决方案1】:

模块 XML 文件中的源路径看起来不正确。该路径应指向相对于 GWT 模块根目录的包(目录名)。由于您的 GWT 模块根目录是 com.messagedna.web,默认源路径是 client,因此您只需从配置中删除源标签即可。

【讨论】:

  • 这个源标签必须指向一个不在客户端包中的类
  • 但我已经注意到这不是一个好主意,并将该类移至客户端包,现在有另一个问题:Validating newly compiled units [INFO] [ERROR] Errors in 'file:/home/mikhail/bzrrep/DLP/DLPServer/src/main/java/com/messagedna/web/client/util/Config.java' [INFO] [ERROR] Line 8: The import java.util.concurrent cannot be resolved [INFO] [ERROR] Line 9: The import java.util.concurrent cannot be resolved 和找不到主类相同。当我删除 Config 类的所有导入时,一切都会编译但不起作用
  • 你在关注这个问题吗??我的答案:stackoverflow.com/questions/15528500/java-timer-in-gwt/…
  • 是的,你不能在 GWT 中使用 java.util.concurrent 类。
  • 您不能在 GWT 中使用java.util.concurrent。尝试使用TimerDeferredCommand 机制。见Programming Delayed Logic
【解决方案2】:

在模块标签&lt;inherits name="com.google.gwt.user.User" /&gt;中添加这一行

【讨论】:

    【解决方案3】:

    你有入口点类,但它没有被编译,因为你有一个编译器或“链接器”错误,这就是为什么要唠叨最后一种情况,因为它不是入口点。

    [INFO] [ERROR] 提示:以前的编译器错误可能已经造成 此类型不可用 [INFO] [ERROR] 提示:检查 来自您的模块的继承链;它可能没有继承 所需模块或模块可能未添加其源路径条目 正确的

    所以检查其他编译器错误或包含的类路径

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 2021-08-11
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2023-03-13
      • 1970-01-01
      相关资源
      最近更新 更多