简体   繁体   English

为什么 Tomcat Maven 插件无法重新部署并出现错误 404?

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

A 404 error is occurring after trying to redeploy via Tomcat Maven plugin, which uses Tomcat Manager to perform this action.尝试通过 Tomcat Maven 插件重新部署后发生 404 错误,该插件使用Tomcat 管理器执行此操作。
It was verified that the Manager application is not available at http://localhost:8080/manager .已验证 Manager 应用程序在http://localhost:8080/manager不可用。

pom.xml: 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

the reason is, missing the docs , manager and host-manager folders in the war files installation path.原因是,war 文件安装路径中缺少docsmanagerhost-manager文件夹。

to fix, copy those files/folders from TOMCAT_DIR/webapps to the relevant war installation path.要修复,请将这些文件/文件夹从TOMCAT_DIR/webapps复制到相关的战争安装路径。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM