【发布时间】:2011-05-11 16:56:40
【问题描述】:
我正在尝试通过启用 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”,取消勾选“launch and deploy from this directory”
- 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?
附:对不起我的英语不好。
【问题讨论】:
-
我也有同样的问题。已经研究了几个小时。显然这是 maven get 插件中的某种类加载问题。
-
我也遇到过这样的问题...
标签: java eclipse gwt maven google-eclipse-plugin