【问题标题】:GWT WebApp finding entry pointGWT WebApp 寻找入口点
【发布时间】:2014-05-15 03:49:39
【问题描述】:

我有一个包含 3 个模块的 maven 项目:api、gwt、web。

web 模块现在创建了 war 文件,我有 2 个 gwt.xml 文件

client.gwt.xml,来自我的 gwt 模块。它实现了视图、演示者、入口点

<module>

    <!-- Inherit the core Web Toolkit stuff. -->
    <inherits name='com.google.gwt.user.User' />
    <inherits name='org.fusesource.restygwt.RestyGWT' />

    <!--Specify the app entry point class. -->
    <entry-point class='com.myapp.admin.client.EntryPoint'/>    

    <source path='rest'/>
    <source path='client'/>
    <source path='consts'/>

</module>

和 web.gwt.xml,来自我的 web 模块,应该在其中部署应用程序。它继承了 gwt 模块,你可以看到 com.myapp.admin.client。

<!-- Inherit the core Web Toolkit stuff. -->
<inherits name='com.google.gwt.user.User' />

<inherits name='com.myapp.admin.client' /> 

我还在我的 pom.xml 中添加了一个依赖模块。但我缺少一些继承,因为:

Compiling module com.myapp.admin.web
   Finding entry point classes
      [ERROR] Unable to find type 'com.myapp.admin.client.EntryPoint
         [ERROR] Hint: Check that the type name 'com.myapp.admin.client.EntryPoint'
         [ERROR] Hint: Check that your classpath includes all required source roots

我可以跟踪跟踪,我理解为什么 com.myapp.admin.client 中没有类路径,因为当我构建我的模块时,只构建来自我的 web 模块的类。但我认为依赖和继承它就足够了。感谢您的帮助。

编辑:POM.xml WEB

        <!-- GWT Maven Plugin -->
    <plugin>
        <groupId>org.codehaus.mojo</groupId>
        <artifactId>gwt-maven-plugin</artifactId>
        <executions>
            <execution>
                <goals>
                    <goal>compile</goal>
                </goals>
            </execution>
        </executions>
        <configuration>

    </plugin>


    <!-- Copy static web files before executing gwt:run -->
    <plugin>
        <groupId>org.apache.maven.plugins</groupId>
        <artifactId>maven-war-plugin</artifactId>
    </plugin>

POM.xml 客户端

<build>
<plugins>
    <plugin>
        <artifactId>maven-source-plugin</artifactId>
        <executions>
            <execution>
                <id>attach-sources</id>
                <phase>verify</phase>
                <goals>
                    <goal>jar-no-fork</goal>
                </goals>
            </execution>
        </executions>
    </plugin>
</plugins>

【问题讨论】:

    标签: java google-app-engine maven gwt


    【解决方案1】:

    我敢打赌你的client jar 不包含 *.java 源文件。 GWT 需要已编译的类和源文件(主要是源文件)。

    http://mojo.codehaus.org/gwt-maven-plugin/user-guide/library.html

    【讨论】:

    • 添加了我的 pom.xml 的一部分,所以主要目标是将 更改为我可以获取源文件的资源(如果是这样的话)。
    • 您需要在 client 模块(或者,如果你在那里source:jar-no-fork,除了&lt;type&gt;jar&lt;/type&gt; 一个之外,你还可以简单地在 client 模块上添加&lt;type&gt;java-source&lt;/type&gt; 依赖项)跨度>
    • 好的完美,知道我的文件编译但是当我尝试以某种方式运行它时,我的应用程序试图找到 [WARN] 404 - GET /client/client.nocache.js (127.0.0.1) 而不是 / web/web.nocache.js(在目标中找到)为什么会这样?我猜命名空间 client.* 来自 client.gwt.xml 但如何?
    • 查看您的 HTML 主机页面;我敢打赌它包含&lt;script src="client/client.nocache.js"&gt;&lt;/script&gt; 而不是&lt;script src="web/web.nocache.js"&gt;&lt;/script&gt;
    猜你喜欢
    • 2011-08-12
    • 2011-08-25
    • 1970-01-01
    • 1970-01-01
    • 2011-04-21
    • 2010-12-17
    • 2012-09-30
    • 2011-10-16
    • 2011-03-18
    相关资源
    最近更新 更多