Harry
Harry

Reputation: 4773

Cannot invoke Tomcat manager

I am trying to deploy my maven application on tomcat using

mvn tomcat:deploy

and getting this error

  [ERROR] BUILD ERROR
  [INFO] ------------------------------------------------------------------------
  [INFO] Cannot invoke Tomcat manager

In maven2/conf/setting.xml I have added

  <server>
   <id>TomcatServer</id>
   <username>tomcat</username>
   <password>tomcat</password>
  </server>

Inside tomcat-users.xml I have added

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

Inside my pom.xml I put

    <plugins>
        <plugin>
            <groupId>org.apache.tomcat.maven</groupId>
            <artifactId>tomcat7-maven-plugin</artifactId>
            <version>2.2</version>
            <configuration>
                <url>http://127.0.0.1:8080/manager/text</url>
                <server>TomcatServer</server>
                <path>/myproject</path>                 
            </configuration>
        </plugin>

Even I tried to deploy the war using tomcat-manager. It deployes but does not start and when I start the the war it says

     FAIL - Application at context path /mywar.net could not be started
FAIL - Encountered exception org.apache.catalina.LifecycleException: Failed to start component [StandardEngine[Catalina].StandardHost[localhost].StandardContext[/mywar.net]]

please let me know if you need more detail

Upvotes: 0

Views: 1483

Answers (1)

Marcelo Barsotti
Marcelo Barsotti

Reputation: 86

The user in your tomcat-users.xml should have manager-script and manager-jmx roles. It also should not have manager-gui role, as this is for users that will use the tomcat manager website, instead of a script that will deploy automatically.

Upvotes: 1

Related Questions