Announcement Announcement Module
Collapse
No announcement yet.
Problem with Maven2 Page Title Module
Move Remove Collapse
X
Conversation Detail Module
Collapse
  • Filter
  • Time
  • Show
Clear All
new posts

  • Problem with Maven2

    Hello, 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.
    Last edited by mujer_esponja; Mar 6th, 2011, 02:51 PM.

  • #2
    Need more information. What version of Roo are you using? Also, please supply your Roo script so I can attempt to reproduce the problem. You are using GAE and it looks like your dependencies have not been satisfied which may be that they were not dlownloaded by Maven.

    Comment


    • #3
      Right now I am not with my computer, but I downloaded just yesterday Spring roo, so I guess it is the last release: 3.0.5.RELEASE
      What do you mean with
      Also, please supply your Roo script
      I followed the example in the tutorial, the same steps, just for try it.
      Thanks

      Comment


      • #4
        3.0.5.RELEASE is almost certainly the Spring Framework release. Roo is currently at 1.1.2.RELEASE. Let me know which example in the tutorial you tried and I will have a look.
        Alan

        Comment


        • #5
          Yes, you are completely right, spring roo last release is 1.1.2.RELEASE
          These are the steps I followed

          mkdir hello
          cd hello
          roo
          roo> hint
          roo> project --topLevelPackage com.foo
          roo> persistence setup --provider HIBERNATE --database HYPERSONIC_IN_MEMORY
          roo> entity --class ~.Timer --testAutomatically
          roo> field string --fieldName message --notNull
          roo> hint controllers
          roo> controller all --package ~.web
          roo> selenium test --controller ~.web.TimerController
          roo> gwt setup
          roo> perform tests
          roo> quit


          Just changing the name of the project and the fields on the database.
          Thanks

          Comment


          • #6
            Just tried your script and it works OK for me - no errors.

            Comment


            • #7
              Could it be then a problem with my maven? I installed it after having roo running, but thinking on it, I repeated the same process, but getting the same error.

              Comment


              • #8
                It may be a Maven issue, but I don't know your environment, so it is difficult to proceed from here.

                Comment


                • #9
                  My OS is windows 7 64bits, and my IDE (just in case, I think it doesn't matter at this pont) is eclipse-java-helios-SR2-win32-x86_64.
                  As I said, I am using maven2.2.1.

                  Thanks

                  Comment


                  • #10
                    Digging deeper on the error, I found this description:

                    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

                    Could be this the clue? How does roo generaate pom.xml file?

                    Comment


                    • #11
                      Back up your project using the Roo 'backup' command from within the shell. Attach the zip file here.

                      Comment


                      • #12
                        I also ran into the same issue by running the sample application. Looks like the google appengine jar files are not found through maven. I attached my project.

                        Comment


                        • #13
                          Originally posted by joevgear View Post
                          I also ran into the same issue by running the sample application. Looks like the google appengine jar files are not found through maven. I attached my project.
                          looks like the zip file is too large for the forum upload. In any event i am using the following:

                          SpringSource Tool Suite

                          Version: 2.6.0.M2

                          roo - 1.1.2.RELEASE [rev fbc33bb]
                          gwt - gwt 2.2
                          google app engine 1.4.2

                          Windows x64 bit.

                          Comment


                          • #14
                            Command `backup` was found but is not curently available

                            I tryed to remove, unzip and put the new folder on the same locatio, but the error is still there.
                            I think I am missing some step, any help please?

                            Comment


                            • #15
                              This thread is a little old now, but just in case anyone is still looking for ideas:

                              [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
                              These errors (which I too encountered with Roo 1.1.2) sound like ROO-2252. The workaround (if you're not actually using GAE) is to delete all packages ending in ".gae" from your project.

                              Could not find artifact com.sun:tools:jar:1.4.2 at specified path C:\Program Files\Java\jre6/../lib/tools.jar -> [Help 1]
                              This might indicate that your JAVA_HOME environment variable isn't pointing to a valid JDK installation. Please make sure you've followed the installation instructions.

                              cannot execute: mojo. It requires a project with an existing pom.xml, but the build is not using one

                              Could be this the clue? How does roo generaate pom.xml file?
                              This error usually means one of two things:
                              * most likely you were not in the project's root directory when you ran mvn.bat, or
                              * you were in that directory, but the pom.xml file doesn't exist; Roo should have created this file when you issued the "project" shell command, but this can fail if for example your anti-virus software prevents it (e.g. I have to disable Trend Micro if I want Roo to manage my POMs properly).

                              Hope this helps.

                              Comment

                              Working...
                              X