0

我有一个 GWT 项目ProjectA,它是一个使用 GWT eclipse 插件生成的简单 Web 应用程序项目。

另外,我还有第二个项目(projectB),它是一个纯 Java 项目,具有以下结构

src/com/test/shared/TestClass.java
src/com/test/Shared.gwt.xml

Shared.gwt.xml 看起来像这样:

<?xml version="1.0" encoding="UTF-8"?>
<module rename-to='shared'>
    <inherits name='com.google.gwt.user.User'/>
    <source path='shared'/>
</module>

TestClass.java 是:

public class TestClass {

  public static void start() {
    // do something    
  }

}

在 projectA 的 gwt.xml 中,我包含了<inherits name="com.test.Shared" />. 我TestClass.start()在projectA的一些方法中使用。然后我将 projectB 包含在 projectA 中。因此,我右键单击 projectA >Properties > Java Build Path > Projects 并添加了 projectB。我切换到Order and Export选项卡并激活了 projectB 上的复选标记。

到目前为止,一切都很好。当我在 projectA 上执行 GWT 编译时,我没有收到任何错误,但是当我在 SuperDevMode 中运行 projectA 时,编译器会打印以下错误:

GET /recompile/mobilePhoneGapIOS
   Job test.mobile.MobilePhoneGapIOS_1_4
      starting job: test.mobile.MobilePhoneGapIOS_1_4
      binding: mgwt.density=xhigh
      Compiling module test.mobile.MobilePhoneGapIOS
         Ignored 1 unit with compilation errors in first pass.
Compile with -strict or with -logLevel set to TRACE or DEBUG to see all errors.
         Computing all possible rebind results for 'com.gwtplatform.mvp.client.ApplicationController'
            Rebinding com.gwtplatform.mvp.client.ApplicationController
               Invoking generator com.gwtplatform.mvp.rebind.ApplicationControllerGenerator
                  [ERROR] The type 'test.mobile.client.BootstrapperImpl' was not found.
         [ERROR] Errors in 'gen/com/google/gwt/lang/test_00046mobile_00046MobilePhoneGapIOS__EntryMethodHolder.java'
            [ERROR] Line 3: Failed to resolve 'com.gwtplatform.mvp.client.ApplicationController' via deferred binding
         [WARN] For the following type(s), generated source was never committed (did you forget to call commit()?)
            [WARN] com.gwtplatform.mvp.client.ApplicationControllerImpl
         Unification traversed 597 fields and methods and 351 types. 2 are considered part of the current module and 22 had all of their fields and methods traversed.
         [WARN] Some stale types ([test.mobile.client.BootstrapperImpl$7, test.mobile.client.BootstrapperImpl$6, test.mobile.client.BootstrapperImpl$5, test.mobile.client.BootstrapperImpl$4, test.mobile.client.BootstrapperImpl$3, test.mobile.client.BootstrapperImpl$2$3, test.mobile.client.BootstrapperImpl, test.mobile.client.BootstrapperImpl$2$2, test.mobile.client.BootstrapperImpl$2, test.mobile.client.BootstrapperImpl$1, com.gwtplatform.dispatch.rest.client.serialization.com_gwtplatform_mvp_client_DesktopGinjector_DesktopGinjectorGinjector_fragment, test.mobile.client.BootstrapperImpl$9, test.mobile.client.BootstrapperImpl$8, com.gwtplatform.mvp.client.com_gwtplatform_mvp_client_DesktopGinjectorImpl, com.gwtplatform.mvp.client.DesktopGinjectorProvider, test.mobile.client.BootstrapperImpl$2$1, test.mobile.client.com_gwtplatform_mvp_client_DesktopGinjector_DesktopGinjectorGinjector_fragment, com.gwtplatform.mvp.client.ClientGinjector, test.mobile.client.BootstrapperImpl$10]) were not reprocessed as was expected. This is either a compiler bug or a Generator has legitimately stopped creating these types.
      [ERROR] Compiler returned false
      [WARN] recompile failed
      [WARN] continuing to serve previous version 

这些错误没有显示 TestClass 类,但是当我将其注释掉(不要使用TestClass.start())时,它在 SDM 中编译没有问题。

我知道我可以预编译 projectB 并将源代码作为 jar lib 包含在 projectA 中,但我希望能够一直修改 projectB 的代码。

如何在使用链接的 projectB 时让 SuperDevMode 工作?

4

1 回答 1

-1

生成器可能需要在您的路径中编译 .class 文件。因此,尝试将您的 bin/(或 Eclipse 调用的任何内容)文件夹包含到类路径中

于 2015-02-03T08:00:36.820 回答