MAVEN Automatic deployment Tomcat error exclusions

Source: Internet
Author: User

In the deployment process of Maven and Tomcat, the most common errors are three, tossing for half a day, finally found the cause of three kinds of errors, and the corresponding perfect solution

1. Connection refused error

The error message is as follows:

[ERROR] Failed to execute goal org.apache.tomcat.maven:tomcat7-maven-plugin:2.0-snapshot:deploy (default-cli) on Pro Ject Helloworld:cannot invoke Tomcat manager:connection refused:connect [Help 1]

Cause: The tomcat server is not started

Workaround: First start the Tomcat server and select Run

2.401 Error

The error message is as follows:

[ERROR] Failed to execute goal org.apache.tomcat.maven:tomcat7-maven-plugin:2.0-snapshot:deploy (defaultfor url:http://Localhost:8080/manager/text/deploy?path=%2fhelloworld [Help 1]

Cause: Permission Issues

Solution in $catalina_base/conf/tomcat-users.xml,

Add permissions like the D:\apache-tomcat-7.0.34\conf\tomcat-users.xml file

<rolename= "Manager"/><user usernamepassword  roles= "Manager"/>

Modify the Pom.xml file and add it in <configuration> </configuration>

< username >admin</username>  <password> Admin</password>

3.403 Error

The error message is as follows:

[ERROR] Failed to execute goal org.apache.tomcat.maven:tomcat7-maven-plugin:2.0-snapshot:deploy (defaultfor url:http://Localhost:8080/manager/html/deploy?path=%2fhelloworld [Help 1]

Cause: The problem is likely to occur for two reasons, see the solution specifically

Workaround:

1) If you are using Tomcat 7, you need to modify the URL address of the deployment in Pom.xml, and change <url>http://localhost:8080/manager</url> to <url>http:// Localhost:8080/manager/text</url>

2) to the Tomcat user rights assignment, need to have both Manager-gui and Manager-script permissions, I encountered this problem, is to forget to assign Manager-script permissions.

The correct conf/tomcat-users.xml configuration should be:

<tomcat-users><rolerolename= "Manager-gui"/><rolerolename= "Manager-script"/><Userusername= "Admin" password= "Admin "Roles= "Manager-gui, manager-script"/></tomcat-users>

MAVEN Automatic deployment Tomcat error exclusions

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.