我正在尝试通过启用 WebAppCreator 的 Maven2 创建一个 GWT 项目。
项目创建步骤:
- 使用 WebAppCreator 创建项目(我使用的是 gwt-2.3.0)->webAppCreator -noant -maven -XnoEclipse -out MyApp com.example.MyApp
- 在eclipse(helios)中将项目导入为现有的maven项目
- 启用“项目”->“属性”->“谷歌”->“谷歌网络工具包”->“使用谷歌网络工具包”复选框
- 在项目属性“Google”->“Web 应用程序”->“这个项目有一个 WAR 目录”中设置。设置 WAR 目录路径“src/main/webapp”并取消选中“从该目录启动和部署”
- Java 构建路径是“MyApp/target/www/WEB-INF/classes”
- 我没有更改 pom.xml 中的设置
- 使用 gwt eclipse 插件(2.3.0 版本)编译项目。它编译成功。
- 尝试将项目作为 Web 应用程序运行。当我运行应用程序 GWT 插件时,不会询问我关于 WAR 文件夹的信息。我做了这一切,我在日志中看到:
[WARN] Server class 'com.example.server.GreetingServiceImpl' could not be found in the web app, but was found on the system classpath
[WARN] Adding classpath entry 'file:/home/redfox/workspace/java/redfox/MyApp/target/www/WEB-INF/classes/' to the web app classpath for this session
[WARN] Server class 'com.google.gwt.user.client.rpc.RemoteService' could not be found in the web app, but was found on the system classpath
[WARN] Adding classpath entry 'file:/home/redfox/.m2/repository/com/google/gwt/gwt-servlet/2.3.0/gwt-servlet-2.3.0.jar' to the web app classpath for this session
当我尝试从 URL ( http://127.0.0.1:8888/MyApp.html?gwt.codesvr=127.0.0.1:9997 ) 加载页面时,我看到 404 错误。在日志中我没有看到任何错误。如何运行此默认应用程序?另外我还有另一个问题:如果这个问题将得到解决,我如何在 web 模式下(而不是在开发模式下)运行这个应用程序来使用像“http://127.0.0.1:8888”这样的链接,而没有参数 gwt.codesvr?
PS对不起我的英语不好。