Maven部署web应用war包到Tomcat 出现 I/O exception (java.net.SocketException) caught when processing request:

在尝试使用Maven部署web应用war包到Tomcat时遇到I/O SocketException。检查Tomcat权限配置后,添加默认角色未解决问题。发现原因是Tomcat在Eclipse中的配置部署路径不正确,修正为Tomcat安装目录后,问题得到解决。

摘要生成于 C知道 ,由 DeepSeek-R1 满血版支持, 前往体验 >

报错信息如下:
Uploading: http://localhost:8090/manager/text/deploy?path=%2Ftest&update=true

[INFO] I/O exception (java.net.SocketException) caught when processing request: Connection reset by peer: socket write error
[INFO] Retrying request
Uploading: http://localhost:8090/manager/text/deploy?path=%2Ftest&update=true

[INFO] I/O exception (java.net.SocketException) caught when processing request: Connection reset by peer: socket write error
[INFO] Retrying request
Uploading: http://localhost:8090/manager/text/deploy?path=%2Ftest&update=true

[INFO] I/O exception (java.net.SocketException) caught when processing request: Connection reset by peer: socket write error
[INFO] Retrying request
Uploading: http://localhost:8090/manager/text/deploy?path=%2Ftest&update=true

[INFO] ------------------------------------------------------------------------
[INFO] BUILD FAILURE
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 22.959 s
[INFO] Finished at: 2017-10-17T16:48:59+08:00
[INFO] Final Memory: 15M/271M
[INFO] ------------------------------------------------------------------------
[ERROR] Failed to execute goal org.apache.tomcat.maven:tomcat7-maven-plugin:2.2:redeploy (default-cli) on project test: Cannot invoke Tomcat manager: Connection reset by peer: socket write error -> [Help 1]
[ERROR] 
[ERROR] To see the full stack trace of the errors, re-run Maven with the -e switch.
[ERROR] Re-run Maven using the -X switch to enable full debug logging.
[ERROR] 
[ERROR] For more information about the errors and possible solutions, please read the following articles:
[ERROR] [Help 1] http://cwiki.apache.org/confluence/display/MAVEN/MojoExecutionException


查询网络后得知是Tomcat权限问题,然后我查看Tomcat用户权限配置:

  <role rolename="tomcat"/>
  <role rolename="role1"/>
  <user password="tomcat" roles="tomcat" username="tomcat"/>
  <user password="tomcat" roles="tomcat,role1" username="both"/>
  <user password="tomcat" roles="role1" username="role1"/>
  
明显不是默认的配置,可能是我之前有做测试修改过。

后来我把默认的一些角色加进去然后测试。。。。还是有报错,没有解决问题。

随后我思考到底是什么原因呢,猛然意识到我的Tomcat在eclipse中的配置默认部署位置是

这样的话manager这个项目在这个目录是不存在的

so 改为Tomcat安装目录再次运行就没有问题了


评论 1
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值