Why is Tomcat Maven Plugin failing to redeploy with error 404?

347 views Asked by At

A 404 error is occurring after trying to redeploy via Tomcat Maven plugin, which uses Tomcat Manager to perform this action.
It was verified that the Manager application is not available at http://localhost:8080/manager.

pom.xml:

<plugin>
    <groupId>org.apache.tomcat.maven</groupId>
    <artifactId>tomcat7-maven-plugin</artifactId>
    <version>2.2</version>
</plugin>

Start server:

mvn tomcat7:run

Redeploy:

mvn package tomcat7:redeploy

Error:

[INFO] --- tomcat7-maven-plugin:2.2:redeploy (default-cli) @ app ---
[INFO] Deploying war to http://localhost:8080/app
Uploading: http://localhost:8080/manager/text/deploy?path=%2Fapp&update=true
Uploaded: http://localhost:8080/manager/text/deploy?path=%2Fapp&update=true (3950 KB at 3253.3 KB/sec)

[ERROR] Tomcat return http status error: 404, Reason Phrase: Not Found
1

There are 1 answers

0
Gayan Chinthaka On

the reason is, missing the manager in the war files installation path.

to fix, copy those files/folders from TOMCAT_DIR/webapps to the relevant war installation path.