Announcement Announcement Module
Collapse
No announcement yet.
mvn tomcat:deploy "Cannot invoke Tomcat manager" Page Title Module
Move Remove Collapse
X
Conversation Detail Module
Collapse
  • Filter
  • Time
  • Show
Clear All
new posts

  • mvn tomcat:deploy "Cannot invoke Tomcat manager"

    Following the tutorial I get to the step where to deploy the first time. When executing mvn tomcat:deploy I get the error "Cannot invoke Tomcat manager", which origins form org.apache.maven.plugin.MojoExecutionException: Cannot invoke Tomcat manager. My guess it has to do with the role and user I specified in tomcat-users.xml (which I have done according to the tutorial).

    Now, the thing is I have several Tomcat instances and, me being a maven novice, I can't figure out which one is being used by mvn tomcat:deploy. I suspect I did not change the correct tomcat-users.xml (the one I changed was in ../SpringSource tc Server v6.0-config/, I also tried the one included with sts 2.3).

    //Carl

  • #2
    Hi, Carl

    On my installation, I only keep one tomcat running and let it use 8080 port. I also have following settings in my [Tomcat directory]/conf/tomcat-users.xml

    <tomcat-users>
    <role rolename="manager"/>
    <user username="admin" password="" roles="manager"/>
    </tomcat-users>

    Hope it helps.

    BTW, you may want to redownload the roo addon zip from springsurf.org and reinstall it.

    1) Download http://www.springsurf.org/downloads/...-roo-addon.zip

    2) Startup Roo and remove existing surf addon

    >> addon uninstall *surf*.zip

    3) Reinstall surf addon using the zip file you just download

    >> addon install file:/[Path-to-your-zip-file]

    Thanks!

    Yong
    Last edited by yqu; Jan 9th, 2010, 10:13 PM.

    Comment


    • #3
      This was a really stupid mistake by me. I assumed that mvn tomcat:deploy started tomcat as well. It works fine if I manually start tomcat before i deploy.
      //Carl

      Comment


      • #4
        I have a similar problem. I have successfully managed to deploy the webapp the first time, but once I've made changes and tried to deploy again, it says...

        Code:
        C:\sprinf-surf-sandbox\community>mvn tomcat:deploy
        [INFO] Scanning for projects...
        [INFO] ------------------------------------------------------------------------
        [INFO] Building community
        [INFO]    task-segment: [tomcat:deploy]
        [INFO] ------------------------------------------------------------------------
        [INFO] Preparing tomcat:deploy
        [INFO] [aspectj:compile {execution: default}]
        [INFO] [resources:resources {execution: default-resources}]
        [WARNING] Using platform encoding (Cp1252 actually) to copy filtered resources, i.e. build is platform dependent!
        [INFO] Copying 2 resources
        [INFO] [compiler:compile {execution: default-compile}]
        [INFO] Nothing to compile - all classes are up to date
        [INFO] [aspectj:test-compile {execution: default}]
        [INFO] [resources:testResources {execution: default-testResources}]
        [WARNING] Using platform encoding (Cp1252 actually) to copy filtered resources, i.e. build is platform dependent!
        [INFO] Copying 0 resource
        [INFO] [compiler:testCompile {execution: default-testCompile}]
        [INFO] Nothing to compile - all classes are up to date
        [INFO] [surefire:test {execution: default-test}]
        [INFO] Surefire report directory: C:\sprinf-surf-sandbox\community\target\surefire-reports
        
        -------------------------------------------------------
         T E S T S
        -------------------------------------------------------
        There are no tests to run.
        
        Results :
        
        Tests run: 0, Failures: 0, Errors: 0, Skipped: 0
        
        [INFO] [war:war {execution: default-war}]
        [INFO] Exploding webapp...
        [INFO] Assembling webapp community in C:\sprinf-surf-sandbox\community\target\community-0.1.0-SNAPSHOT
        [INFO] Copy webapp webResources to C:\sprinf-surf-sandbox\community\target\community-0.1.0-SNAPSHOT
        [INFO] Generating war C:\sprinf-surf-sandbox\community\target\community-0.1.0-SNAPSHOT.war
        [INFO] Building war: C:\sprinf-surf-sandbox\community\target\community-0.1.0-SNAPSHOT.war
        [INFO] [tomcat:deploy {execution: default-cli}]
        [INFO] Deploying war to http://localhost:8080/community
        [INFO] ------------------------------------------------------------------------
        [ERROR] BUILD ERROR
        [INFO] ------------------------------------------------------------------------
        [INFO] Cannot invoke Tomcat manager: FAIL - Application already exists at path /community
        
        [INFO] ------------------------------------------------------------------------
        [INFO] For more information, run Maven with the -e switch
        [INFO] ------------------------------------------------------------------------
        [INFO] Total time: 5 seconds
        [INFO] Finished at: Sun Jan 10 19:41:43 GMT 2010
        [INFO] Final Memory: 18M/47M
        [INFO] ------------------------------------------------------------------------
        I tried, mvn tomcat:redeploy, which seemed to be successful, but resulted in

        Code:
        HTTP Status 404 - /community/
        
        type Status report
        
        message /community/
        
        description The requested resource (/community/) is not available.
        Apache Tomcat/6.0.20

        Comment


        • #5
          For the second time, you might want to try

          mvn tomcat:redeploy

          Yong

          Comment


          • #6
            Tried that, that results in the 404 message. See bottom of my last post.

            Comment


            • #7
              And for some reason, it resets the changes back to the main template.

              For example. I made changes as per the tutorial to

              C:\sprinf-surf-sandbox\community\src\main\webapp\WEB-INF\webscripts\footer\footer.get.js

              To give a different footer. I deployed it initially using mvn tomcat:deploy and it deployed successfully to the tomcat server.

              However when going back into the same file, it has reverted back to the original file.

              Comment


              • #8
                Getting the following message in the tomcat logs when trying mvn tomcat:redeploy

                [TomcatAspectJWeavingClassLoader@1ca2b38] warning javax.* types are not being wo
                ven because the weaver option '-Xset:weaveJavaxPackages=true' has not been speci
                fied

                Comment


                • #9
                  Are you using a clean installation of Tomcat 6? Can you try to clean up tomcat temp, work directory and remove the deployed webapp (both war file and expanded directory) from webapps directory?

                  Yong

                  Comment


                  • #10
                    Yes, it was a clean version of tomcat.

                    Cleaning things up helps, but I don't want to have to do that everytime I want to deploy changes.

                    On the flip side, doing it via STS seems to work nicely.

                    Comment


                    • #11
                      Hi,

                      Once you cleaned it up, can you try

                      1) run tomcat:deploy for the first deployment.
                      2) run tomcat:redeploy for the following deployments.

                      Do you still get same issue?

                      Yong

                      Comment


                      • #12
                        Originally posted by yqu View Post
                        Hi,

                        Once you cleaned it up, can you try

                        1) run tomcat:deploy for the first deployment.
                        2) run tomcat:redeploy for the following deployments.

                        Do you still get same issue?

                        Yong
                        Yong, I am having the same issues. What appears to be happening is tomcat is locking on all the libraries in the community folder. If you attempt to undeploy the app, it removes everything except the lib folder due to file locks. stopping the webapp does not remove these file locks. The only way around this that I have figured is to re-start tomcat, undeploy community and redeploy.

                        I do not know if this is a OS depenedent issue as I am running on Windows 7 and don't have the time currently to investigate other operating systems.

                        I am also running as Tomcat 6 (latest) as a windows service on windows 7

                        edit....
                        Additionally, because of these file locks, after the first deploy, redeploy and undeploy do not work correctly.
                        Last edited by gbags; Jan 11th, 2010, 07:59 AM.

                        Comment


                        • #13
                          Hi,

                          I am using Windows XP and Tomcat 6.0.20. The redeploy works fine.

                          Yong

                          Comment


                          • #14
                            Load-time weaving is the cause

                            I have the exact same issue on XP with tomcat 6.0.20. This only happens when I use spring-tomcat-weaver.jar to do the load-time-weaving of Aspectj aspects. gbags is probably weaving and yqu is probably not.

                            That weaver was the only one that I could get working reliably. It could be that the others (using a -javaagent) work the first time but not after a redeploy. If anyone knows how to get redeploy working again, please comment.

                            Comment


                            • #15
                              Same problem

                              Hi,
                              I have the same problem. I have LDAP security in the realm of the server.xml.
                              When trying to build with the maven, it is looking for the default user authentication (admin/"") for the manager application and fails.
                              Any help?

                              Comment

                              Working...
                              X