Reputation: 11
I am just starting with spring Roo, and following the tutorial I face the error below while running
roo> perform tests
I have maven2.2.1 installed already in my computer.
[Thread-8] 8701K downloaded (aspectjtools-1.6.11.M2.jar)
[Thread-8] [INFO] [aspectj:compile {execution: default}]
[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] 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] User cannot be resolved to a type
[Thread-8] [WARNING] advice defined in org.springframework.scheduling.aspectj.Ab
stractAsyncExecutionAspect has not been applied [Xlint:adviceDidNotMatch]
[Thread-8] [WARNING] advice defined in org.springframework.mock.staticmock.Annot
ationDrivenStaticEntityMockingControl has not been applied [Xlint:adviceDidNotMa
tch]
[Thread-8] [WARNING] advice defined in org.springframework.mock.staticmock.Abstr
actMethodMockingControl has not been applied [Xlint:adviceDidNotMatch]
[Thread-8] [INFO] --------------------------------------------------------------
----------
[Thread-8] [ERROR] BUILD ERROR
[Thread-8] [INFO] --------------------------------------------------------------
----------
[Thread-8] [INFO] Compiler errors :
[Thread-8] error at import com.google.appengine.api.users.User;
[Thread-8] ^^^^^^^^^^^^^^^^^^^
[Thread-8] C:\Users\mujer_esponja\Desktop\automatlabs\src\mai n\java\com\foo\serv
er\gae\UserServiceLocator.java:3:0::0 The import com.google.appengine cannot be
resolved
[Thread-8] error at import com.google.appengine.api.users.UserService;
[Thread-8] ^^^^^^^^^^^^^^^^^^^
[Thread-8] C:\Users\mujer_esponja\Desktop\automatlabs\src\mai n\java\com\foo\serv
er\gae\UserServiceLocator.java:4:0::0 The import com.google.appengine cannot be
resolved
[Thread-8] error at import com.google.appengine.api.users.UserServiceFactory;
[Thread-8] ^^^^^^^^^^^^^^^^^^^
[Thread-8] C:\Users\mujer_esponja\Desktop\automatlabs\src\mai n\java\com\foo\serv
er\gae\UserServiceLocator.java:5:0::0 The import com.google.appengine cannot be
resolved
[Thread-8] error at final UserService service = UserServiceFactory.getUserServic
e();
[Thread-8] ^^^^^^^^
[Thread-8] C:\Users\mujer_esponja\Desktop\automatlabs\src\mai n\java\com\foo\serv
er\gae\UserServiceLocator.java:13:0::0 UserService cannot be resolved to a type
[Thread-8] error at final UserService service = UserServiceFactory.getUserServic
e();
[Thread-8] ^^^^^^^^^^^^^^^
[Thread-8] C:\Users\mujer_esponja\Desktop\automatlabs\src\mai n\java\com\foo\serv
er\gae\UserServiceLocator.java:13:0::0 UserServiceFactory cannot be resolved
[Thread-8] error at public User getCurrentUser() {
[Thread-8]
[Thread-8] C:\Users\mujer_esponja\Desktop\automatlabs\src\mai n\java\com\foo\serv
er\gae\UserServiceLocator.java:24:0::0 User cannot be resolved to a type
[Thread-8] error at import com.google.appengine.api.users.UserService;
[Thread-8] ^^^^^^^^^^^^^^^^^^^
[Thread-8] C:\Users\mujer_esponja\Desktop\automatlabs\src\mai n\java\com\foo\serv
er\gae\GaeAuthFilter.java:3:0::0 The import com.google.appengine cannot be resol
ved
[Thread-8] error at import com.google.appengine.api.users.UserServiceFactory;
[Thread-8] ^^^^^^^^^^^^^^^^^^^
[Thread-8] C:\Users\mujer_esponja\Desktop\automatlabs\src\mai n\java\com\foo\serv
er\gae\GaeAuthFilter.java:4:0::0 The import com.google.appengine cannot be resol
ved
[Thread-8] error at UserService userService = UserServiceFactory.getUserService(
);
[Thread-8] ^^^^^^^^
[Thread-8] C:\Users\mujer_esponja\Desktop\automatlabs\src\mai n\java\com\foo\serv
er\gae\GaeAuthFilter.java:21:0::0 UserService cannot be resolved to a type
[Thread-8] error at UserService userService = UserServiceFactory.getUserService(
);
[Thread-8] ^^^^^^^^^^^^^^^
[Thread-8] C:\Users\mujer_esponja\Desktop\automatlabs\src\mai n\java\com\foo\serv
er\gae\GaeAuthFilter.java:21:0::0 UserServiceFactory cannot be resolved
[Thread-8] error at import com.google.appengine.api.users.User;
[Thread-8] ^^^^^^^^^^^^^^^^^^^
[Thread-8] C:\Users\mujer_esponja\Desktop\automatlabs\src\mai n\java\com\foo\serv
er\gae\UserServiceWrapper.java:3:0::0 The import com.google.appengine cannot be
resolved
[Thread-8] error at public User getCurrentUser();
[Thread-8] ^^
[Thread-8] C:\Users\mujer_esponja\Desktop\automatlabs\src\mai n\java\com\foo\serv
er\gae\UserServiceWrapper.java:16:0::0 User cannot be resolved to a type
[Thread-8]
[Thread-8] [INFO] --------------------------------------------------------------
----------
[Thread-8] [INFO] For more information, run Maven with the -e switch
[Thread-8] [INFO] --------------------------------------------------------------
----------
[Thread-8] [INFO] Total time: 20 minutes 53 seconds
[Thread-8] [INFO] Finished at: Sun Mar 06 18:33:34 CET 2011
[Thread-8] [INFO] Final Memory: 26M/64M
[Thread-8] [INFO] --------------------------------------------------------------
----------
The command 'mvn.bat test' did not complete successfully
roo>
Then I tryed to execute
roo> perform tests
And when importing to eclipse, I faced this error:
Failed to execute goal org.codehaus.mojo:aspectj-maven-plugin:1.0:compile (default) on project foo: Execution default of goal org.codehaus.mojo:aspectj-maven-plugin:1.0:compile failed: Plugin org.codehaus.mojo:aspectj-maven-plugin:1.0 or one of its dependencies could not be resolved: Could not find artifact com.sun:tools:jar:1.4.2 at specified path C:\Program Files\Java\jre6/../lib/tools.jar -> [Help 1]
Any help would be grateful.
EDIT:
Following yyour suggestions I realized that the problem is in maven-eclipse-plugin-2.8.jar
Running
roo>perform eclipse
The commandmvn.bat eclipse:clean eclipse:eclipse
did not complet successfully
So I decided to run it appart, to check why, and I faced:
Required goal not found: eclipse:eclipse in org.apache.maven.plugin:maven-eclipse-plugin-2.8.jar
But I went to the folder specified, and the jar is just there, what could be the problem??
.m2\repository\org\apache\maven\plugins\maven-eclipse-plugin\2.8\maven-eclipse-plugin-2.8.jar
Making something similar with another command which did not complet succesfully
mvn.bat test
I face this other error:
cannot execute: mojo. It requires a project with an existing pom.xml, but the build is not using one
Maybe in this secon error is the clue. How does roo create a pom.xml???
Upvotes: 1
Views: 4134
Reputation: 547
After a lot of searching around, finally I found the issue causing this problem. It has to do with the path of the tools jar configured in the aspectj plugin (in your .m2 repo) There is a similar issue where I provide further details.
Upvotes: 1
Reputation: 11
Yeah this caused me a lot of fuss too. It seems that it is a simple documentation error on their part:
http://empire5.com/development/spring-roo-1-1-2-hangup/
Upvotes: 1
Reputation: 6802
I experienced these types of problems for a while. I had my JAVA_HOME and path pointing to an older JDK which was causing my problems.
Upvotes: 0
Reputation: 4177
I had the same problem - 2 things are tried that seem to made it work.
Unzipped and set up the Roo again. Do this if you see "Unknown Version" when Roo starts up.
This one seemed to fix it. Check your local maven repo. Navigate to where codehaus jar should be downloaded. Delete the lastUpdated file and clean that folder. Update your Maven dependencies or run the Roo command again. Make sure you are able to connect to remote maven repo.
Hope that helps. Let me know how it goes.
Upvotes: 2