1

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 command mvn.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???

4 Answers4

2

I had the same problem - 2 things are tried that seem to made it work.

  1. Unzipped and set up the Roo again. Do this if you see "Unknown Version" when Roo starts up.

  2. 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.

Nilesh
  • 4,137
  • 6
  • 39
  • 53
  • It usually means there is no pom.xml in the current directory where you're trying to build. Perhaps you need to change into the subdirectory that contains your project? – Nilesh Mar 08 '11 at 07:55
  • I don't know what you mean, I tryed to delete the whole folder and create everything from scratch, but still the same, Some configuration is needed in my computer?? – Bea Gonzalez Gutierrez Mar 09 '11 at 16:28
  • do you have maven configured right? do you see pom.xml in the folder where you are trying to run this command? do you have any build errors? – Nilesh Mar 09 '11 at 18:13
  • I have no pom.xml file, in whicch point it is create3d during the proocess specified in the tutorial I folowed?? http://www.springsource.org/roo/start – Bea Gonzalez Gutierrez Mar 10 '11 at 16:49
  • it should be created during the first step "project --topLevelPackage com.foo". After running this command - check if the pom.xml file is created or are there any errors while running this command. – Nilesh Mar 11 '11 at 14:00
  • Deleting all the codehaus jars from my repo seemed to help me. At least with that problem, now on the next problem ;) – Danny C Apr 28 '11 at 16:54
  • For me it helped to delete this directory: C:\Users\MYUSERNAME\SpringSource Tool Suite\spring-roo-1.2.5.RELEASE\sts-cache-MYPROJECT – Matthias Wuttke Sep 02 '15 at 19:40
1

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.

Community
  • 1
  • 1
Chris
  • 549
  • 1
  • 5
  • 18
1

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/

Nick
  • 11
  • 1
0

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.

IcedDante
  • 6,145
  • 12
  • 57
  • 100