猿问

通过Maven在tomcat9上部署War时出错-Windows

任何帮助将不胜感激,因为此配置可在Mac上运行,但不适用于Windows计算机。


我的命令:mvn clean install && mvn tomcat7:redeploy


错误信息:


--- tomcat7-maven-plugin:2.2:redeploy (default-cli) @ web-customer-tracker ---

[INFO] Deploying war to http://localhost:8080/web-customer-tracker

Uploading: http://localhost:8080/manager/text/deploy?path=%2Fweb-customer-tracker&update=true

2692/20011 KB

[INFO] I/O exception (java.net.SocketException) caught when processing request: Connection reset by peer: socket write error

[INFO] Retrying request

Uploading: http://localhost:8080/manager/text/deploy?path=%2Fweb-customer-tracker&update=true

2692/20011 KB

[INFO] I/O exception (java.net.SocketException) caught when processing request: Connection reset by peer: socket write error

[INFO] Retrying request

Uploading: http://localhost:8080/manager/text/deploy?path=%2Fweb-customer-tracker&update=true

2884/20011 KB

[INFO] I/O exception (java.net.SocketException) caught when processing request: Connection reset by peer: socket write error

[INFO] Retrying request

Uploading: http://localhost:8080/manager/text/deploy?path=%2Fweb-customer-tracker&update=true

2884/20011 KB

[INFO] ------------------------------------------------------------------------

[INFO] BUILD FAILURE

[INFO] ------------------------------------------------------------------------

[INFO] Total time: 9.686 s

[INFO] Finished at: 2018-07-14T21:19:25+05:30

[INFO] ------------------------------------------------------------------------

[ERROR] Failed to execute goal org.apache.tomcat.maven:tomcat7-maven-plugin:2.2:redeploy (default-cli) on project web-customer-tracker: Cannot invoke Tomcat manager: Connection reset by peer: socket write error -> [Help 1]

Tomcat在端口8080上运行


米琪卡哇伊
浏览 217回答 2
2回答

holdtom

这解决了以下错误:无法调用Tomcat管理器:对等连接重置:套接字写入错误以管理员身份运行,启动两个单独的命令提示符终端。在第一个终端中,转到您的tomcat bin目录并运行shutdown.bat,然后在我的情况下运行startup.bat c:\ Program Files \ Apache Software Foundation \ apache-tomcat-8.5.8 \ bin> shutdown.bat c:\程序文件\ Apache Software Foundation \ apache-tomcat-8.5.8 \ bin> startup.bat在第二个终端中,转到您的maven webapp目录,然后运行mvn命令。以我为例,MVN tomcat7:deploy将会成功!!!

子衿沉夜

尝试了几乎所有内容之后,我在m2中删除了settings.xml。然后我在pom.xml中进行了以下更改<build>&nbsp; &nbsp; <plugins>&nbsp; &nbsp; &nbsp; &nbsp; <plugin>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <groupId>org.apache.tomcat.maven</groupId>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <artifactId>tomcat7-maven-plugin</artifactId>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <version>2.2</version>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <configuration>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <url>http://localhost:8080/manager/text</url>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <server>TomcatServer</server>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <username>admin</username>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <password>password</password>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <path>/web-customer-tracker</path>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; </configuration>&nbsp; &nbsp; &nbsp; &nbsp; </plugin>&nbsp; &nbsp; </plugins>&nbsp; &nbsp; <finalName>web-customer-tracker</finalName></build>我将settings.xml中的用户名和密码添加到pom文件中,并且可以正常工作。请不要在基于UNIX的系统上不会发生此问题。
随时随地看视频慕课网APP

相关分类

Java
我要回答