为了账号安全,请及时绑定邮箱和手机立即绑定

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

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

米琪卡哇伊 2021-05-14 15:01:33
任何帮助将不胜感激,因为此配置可在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-trackerUploading: http://localhost:8080/manager/text/deploy?path=%2Fweb-customer-tracker&update=true2692/20011 KB[INFO] I/O exception (java.net.SocketException) caught when processing request: Connection reset by peer: socket write error[INFO] Retrying requestUploading: http://localhost:8080/manager/text/deploy?path=%2Fweb-customer-tracker&update=true2692/20011 KB[INFO] I/O exception (java.net.SocketException) caught when processing request: Connection reset by peer: socket write error[INFO] Retrying requestUploading: http://localhost:8080/manager/text/deploy?path=%2Fweb-customer-tracker&update=true2884/20011 KB[INFO] I/O exception (java.net.SocketException) caught when processing request: Connection reset by peer: socket write error[INFO] Retrying requestUploading: http://localhost:8080/manager/text/deploy?path=%2Fweb-customer-tracker&update=true2884/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上运行
查看完整描述

2 回答

?
holdtom

TA贡献1805条经验 获得超10个赞

这解决了以下错误:无法调用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

将会成功!!!


查看完整回答
反对 回复 2021-05-26
?
子衿沉夜

TA贡献1828条经验 获得超3个赞

尝试了几乎所有内容之后,我在m2中删除了settings.xml。然后我在pom.xml中进行了以下更改


<build>

    <plugins>

        <plugin>

            <groupId>org.apache.tomcat.maven</groupId>

            <artifactId>tomcat7-maven-plugin</artifactId>

            <version>2.2</version>

            <configuration>

                <url>http://localhost:8080/manager/text</url>

                <server>TomcatServer</server>

                <username>admin</username>

                <password>password</password>

                <path>/web-customer-tracker</path>

            </configuration>

        </plugin>

    </plugins>

    <finalName>web-customer-tracker</finalName>

</build>

我将settings.xml中的用户名和密码添加到pom文件中,并且可以正常工作。请不要在基于UNIX的系统上不会发生此问题。


查看完整回答
反对 回复 2021-05-26
  • 2 回答
  • 0 关注
  • 216 浏览

添加回答

举报

0/150
提交
取消
意见反馈 帮助中心 APP下载
官方微信