gpt4 book ai didi

java - Tomcat7 maven 插件-处理请求时捕获 I/O 异常 (java.net.SocketException) : Broken pipe

转载 作者:行者123 更新时间:2023-11-28 22:16:17 25 4
gpt4 key购买 nike

我一直在尝试使用 mvn tomcat7:deploy 命令部署我的 WAR 文件,但我遇到了管道损坏错误。我正在使用 Ubuntu。这是所需的文件。

这是 POM.xml

  <plugins>
<plugin>
<groupId>org.apache.tomcat.maven</groupId>
<artifactId>tomcat7-maven-plugin</artifactId>
<version>2.0</version>
<configuration>
<url>http://localhost:8080/manager/text</url>
<server>TomcatServer</server>
<path>/helloworld</path>
</configuration>
</plugin>
</plugins>

我的/conf/settings.xml for tomcat有

<server>
<id>TomcatServer</id>
<username>maven</username>
<password>maven</password>

和tomcatusers.xml如下

  <role rolename="manager-gui"/>
<role rolename="manager-script"/>
<role rolename="admin"/>
<user username="maven" password="maven" roles="admin,managerscript,manager-gui"/>

使用以下命令进行部署

mvn tomcat7:deploy

我得到这些错误

> Uploading: http://localhost:8080/manager/text/deploy?path=%2Fhelloworld
120/23235 KB
Feb 28, 2018 1:11:42 PM org.apache.http.impl.client.DefaultRequestDirector tryExecute
INFO: I/O exception (java.net.SocketException) caught when processing request: Connection reset
Feb 28, 2018 1:11:42 PM org.apache.http.impl.client.DefaultRequestDirector tryExecute
INFO: Retrying request
Uploading: http://localhost:8080/manager/text/deploy?path=%2Fhelloworld
2/23235 KB
Feb 28, 2018 1:11:42 PM org.apache.http.impl.client.DefaultRequestDirector tryExecute
INFO: I/O exception (java.net.SocketException) caught when processing request: Broken pipe (Write failed)
Feb 28, 2018 1:11:42 PM org.apache.http.impl.client.DefaultRequestDirector tryExecute
INFO: Retrying request
Uploading: http://localhost:8080/manager/text/deploy?path=%2Fhelloworld
2/23235 KB
Feb 28, 2018 1:11:42 PM org.apache.http.impl.client.DefaultRequestDirector tryExecute
INFO: I/O exception (java.net.SocketException) caught when processing request: Broken pipe (Write failed)
Feb 28, 2018 1:11:42 PM org.apache.http.impl.client.DefaultRequestDirector tryExecute
INFO: Retrying request
Uploading: http://localhost:8080/manager/text/deploy?path=%2Fhelloworld
2/23235 KB
[INFO] ------------------------------------------------------------------------
[INFO] BUILD FAILURE
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 10.061 s
[INFO] Finished at: 2018-02-28T13:11:42+05:00
[INFO] Final Memory: 15M/60M
[INFO] ------------------------------------------------------------------------
[ERROR] Failed to execute goal org.apache.tomcat.maven:tomcat7-maven-plugin:2.0:deploy (default-cli) on project springmvc-helloworld: Cannot invoke Tomcat manager: Broken pipe (Write failed) -> [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

我一直在寻找一段时间,但无法解决这个问题。

最佳答案

在您的 tomcatusers.xml 中,对于您具有角色“managerscript”的用户 maven,将其更改为 manager-script。此外,如果您从除 tomcat 所在的其他机器上运行 maven,请使用机器的 ip 地址并确保端口 8080 已打开以进行通信。

关于java - Tomcat7 maven 插件-处理请求时捕获 I/O 异常 (java.net.SocketException) : Broken pipe,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/49024865/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com