Page 1 of 2 12 LastLast
Results 1 to 10 of 15

Thread: mvn tomcat:deploy "Cannot invoke Tomcat manager"

  1. #1
    Join Date
    Jan 2010
    Posts
    2

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

    Default

    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 at 10:13 PM.

  3. #3
    Join Date
    Jan 2010
    Posts
    2

    Default

    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

  4. #4
    Join Date
    Jan 2010
    Location
    Scotland
    Posts
    27

    Default

    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

  5. #5

    Default

    For the second time, you might want to try

    mvn tomcat:redeploy

    Yong

  6. #6
    Join Date
    Jan 2010
    Location
    Scotland
    Posts
    27

    Default

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

  7. #7
    Join Date
    Jan 2010
    Location
    Scotland
    Posts
    27

    Default

    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.

  8. #8
    Join Date
    Jan 2010
    Location
    Scotland
    Posts
    27

    Default

    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

  9. #9

    Default

    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

  10. #10
    Join Date
    Jan 2010
    Location
    Scotland
    Posts
    27

    Default

    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.

Tags for this Thread

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •