springroo无法设置gwt

时间:2011-03-16 15:54:01

标签: gwt spring-roo

我有春天的路线1.1.2。我正在创建像

这样的新项目
project --topLevelPackage leraning.roogwt

然后我设置持久性并添加实体

persistence setup --provider HIBERNATE --database HYPERSONIC_IN_MEMORY
entity --class ~.MyEntity
field string description

设置gwt

gwt setup

当我尝试打包它时,发生编译错误

perform package

错误

[Thread-8] [ERROR] The import com.google.appengine cannot be resolved
[Thread-8] [ERROR] User cannot be resolved to a type
[Thread-8] [ERROR] The import com.google.appengine cannot be resolved
[Thread-8] [ERROR] UserService cannot be resolved to a type
[Thread-8] [ERROR] UserServiceFactory cannot be resolved
[Thread-8] [ERROR] The import com.google.appengine cannot be resolved
[Thread-8] [ERROR] UserService cannot be resolved to a type
[Thread-8] [ERROR] UserServiceFactory cannot be resolved
[Thread-8] [ERROR] User cannot be resolved to a type

并在代码中详细说明

[Thread-8] [ERROR] Failed to execute goal org.codehaus.mojo:aspectj-maven-plugin:1.0:compile (default) on project roogwt: Compiler errors :
[Thread-8] [ERROR] error at import com.google.appengine.api.users.User;
[Thread-8] [ERROR] ^^^^^^^^^^^^^^^^^^^
[Thread-8] [ERROR] J:\springroo\gwtroo\src\main\java\leraning\roogwt\server  \gae\UserServiceWrapper.java:3:0::0 The import com.google.appengine cannot be resolved
[Thread-8] [ERROR] error at public User getCurrentUser();
[Thread-8] [ERROR] ^^
[Thread-8] [ERROR] J:\springroo\gwtroo\src\main\java\leraning\roogwt\server\gae\UserServiceWrapper.java:16:0::0 User cannot be resolved to a type
[Thread-8] [ERROR] error at import com.google.appengine.api.users.UserService;
[Thread-8] [ERROR] ^^^^^^^^^^^^^^^^^^^
[Thread-8] [ERROR] J:\springroo\gwtroo\src\main\java\leraning\roogwt\server\gae\GaeAuthFilter.java:3:0::0 The import com.google.appengine cannot be re..... 
<similar errors in other files>

4 个答案:

答案 0 :(得分:4)

我在Roo示例expense.roo项目中遇到了同样的问题。我通过将缺少的maven依赖项添加到项目中来解决它。

从Roo shell运行:

  

依赖项添加--groupId   com.google.appengine --artifactId   appengine-api-1.0-sdk --version 1.4.0

答案 1 :(得分:1)

我不知道我的解决方案是否合适,但我刚刚从名为gae的src文件夹中删除了所有文件夹,现在我已经构建并部署了示例gwt项目而没有任何问题。

答案 2 :(得分:1)

另一种选择是在设置perrsistence时将google app引擎指定为数据库。

持久性设置 - 提供者DATANUCLEUS - 数据库GOOGLE_APP_ENGINE

这可以避免无法找到谷歌应用引擎相关参考的错误。

答案 3 :(得分:0)

这已在Roo 1.1.4中修复:

https://jira.springsource.org/browse/ROO-2374