1.Connection refused錯誤html
報錯信息以下:web
[ERROR]Failed to execute goal org.apache.tomcat.maven: tomcat7-maven-plugin: 2.0- SNAPSHOT: deploy (default-cli) on project helloworld: Cannot invoke Tomcat manager: Connection refused: connect -> [Help 1]
緣由:未啓動Tomcat服務器apache
解決辦法:先啓動Tomcat服務器再選擇Runtomcat
2. 401錯誤服務器
報錯信息以下:app
[ERROR] Failed to execute goal org.apache.tomcat.maven:tomcat7-maven-plugin: 2.0-SNAPSHOT:deploy (default-cli) on project helloworld: Cannot invoke Tomcat manager: Server returned HTTP response code: 401 for URL: http://localhost:8080/manager/text/deploy?path=%2Fhelloworld -> [Help 1]
緣由:權限問題webapp
解決辦法在$CATALINA_BASE/conf/tomcat-users.xml,maven
如D:\apache-tomcat-7.0.34\conf\tomcat-users.xml文件中添加權限ui
<role rolename=」manager」/> <user username=」admin」 password=」admin」 roles=」manager」/>
修改pom.xml文件,在<configuration> url
</configuration>中添加
<username>admin</username> <password>admin</password>
3.403錯誤
報錯信息以下:
[ERROR] Failed to execute goal org.apache.tomcat.maven:tomcat7-maven-plugin: 2.0-SNAPSHOT:deploy (default-cli) on project helloworld: Cannot invoke Tomcat manager: Server returned HTTP response code: 403 for URL: http://localhost:8080/manager/html/deploy?path=%2Fhelloworld -> [Help 1]
緣由:產生該問題有可能由於兩個緣由,具體參看法決辦法
解決辦法:
1)若是使用的是Tomcat 7,須要修改pom.xml中部署的url地址,將
<url>http://localhost:8080/manager</url>
改
<url>http://localhost:8080/manager/text</url>
在此次部署的問題上,我就是遇到了url 的問題,我用的是tomcat7
2)給tomcat用戶權限分配上,須要同時具有manager-gui和manager-script權限
正確的conf/tomcat-users.xml配置應爲:
<tomcat-users> <role rolename="manager-gui"/> <role rolename="manager-script"/> <user username="admin」 password="admin" roles="manager-gui, manager-script"/> </tomcat-users>
四、上傳war 包過大錯誤 ---感謝 5樓 楊木祥 童鞋的提供
配置正確的狀況下,由包太大,超過默認的50M,致使上傳失敗。
查看manager log發現,報如下異常:
SEVERE: HTMLManager: FAIL - Deploy Upload Failed, Exception: org.apache.tomcat.util.http.fileupload.FileUploadBase$SizeLimitExceededException: the request was rejected because its size (74072771) exceeds the configured maximum (52428800)
解決方案
修改/webapps/manager/WEB-INF/web.xml中,
<max-file-size>100000000</max-file-size> <max-request-size>100000000</max-request-size>
能夠解決。