简体   繁体   English

Tomcat 7 maven 插件 - 处理请求时捕获的 I/O 异常 (java.net.SocketException):管道损坏

[英]Tomcat 7 maven plugin - I/O exception (java.net.SocketException) caught when processing request: Broken pipe

I read all the questions regarding my issue with no success... I'm depolying my war with maven and I want it to go to tomcat server on another ip.我阅读了有关我的问题的所有问题但没有成功......我正在与 maven 展开我的战争,我希望它转到另一个 ip 上的 tomcat 服务器。

I followed all the settings...我遵循了所有设置...

My POM for the plugin我的插件 POM

<plugin>
        <groupId>org.apache.tomcat.maven</groupId>
        <artifactId>tomcat7-maven-plugin</artifactId>
        <version>2.2</version>
        <configuration>
            <url>http://192.168.3.67:8080/manager/text</url>
            <server>TomcatServer</server>
            <path>webapp</path>
        </configuration>
    </plugin>

My /conf/settings.xml for tomcat has我的 /conf/settings.xml for tomcat 有

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

And tomcat-user.xml is as follows而tomcat-user.xml如下

<role rolename="manager-gui"/>
<role rolename="manager-script"/>
<user username="system" password="raspberry" roles="manager-gui"/>
<user username="maven" password="maven" roles="manager-script"/>

When I try to deploy the application I got当我尝试部署应用程序时,我得到了

[INFO] Deploying war to http://192.168.3.67:8080/manager/webapp  
Uploading: http://192.168.3.67:8080/manager/text/deploy?path=webapp
2472/14845 KB   
[INFO] I/O exception (java.net.SocketException) caught when processing request: Broken pipe
[INFO] Retrying request
Uploading: http://192.168.3.67:8080/manager/text/deploy?path=webapp
2384/14845 KB   
[INFO] I/O exception (java.net.SocketException) caught when processing request: Broken pipe
[INFO] Retrying request
Uploading: http://192.168.3.67:8080/manager/text/deploy?path=webapp
2398/14845 KB   
[INFO] I/O exception (java.net.SocketException) caught when processing request: Broken pipe
[INFO] Retrying request
Uploading: http://192.168.3.67:8080/manager/text/deploy?path=webapp
2472/14845 KB   
[INFO] ------------------------------------------------------------------------
[INFO] BUILD FAILURE
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 5.867 s
[INFO] Finished at: 2015-11-25T14:58:05+01:00
[INFO] Final Memory: 17M/228M
[INFO] ------------------------------------------------------------------------
[ERROR] Failed to execute goal org.apache.tomcat.maven:tomcat7-maven-plugin:2.2:deploy (default-cli) on project webapp: Cannot invoke Tomcat manager: Broken pipe -> [Help 1]
org.apache.maven.lifecycle.LifecycleExecutionException: Failed to execute goal org.apache.tomcat.maven:tomcat7-maven-plugin:2.2:deploy (default-cli) on project webapp: Cannot invoke Tomcat manager
    at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:216)
    at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:153)
    at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:145)
    at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject(LifecycleModuleBuilder.java:116)
    at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject(LifecycleModuleBuilder.java:80)
    at org.apache.maven.lifecycle.internal.builder.singlethreaded.SingleThreadedBuilder.build(SingleThreadedBuilder.java:51)
    at org.apache.maven.lifecycle.internal.LifecycleStarter.execute(LifecycleStarter.java:128)
    at org.apache.maven.DefaultMaven.doExecute(DefaultMaven.java:307)
    at org.apache.maven.DefaultMaven.doExecute(DefaultMaven.java:193)
    at org.apache.maven.DefaultMaven.execute(DefaultMaven.java:106)
    at org.apache.maven.cli.MavenCli.execute(MavenCli.java:862)
    at org.apache.maven.cli.MavenCli.doMain(MavenCli.java:286)
    at org.apache.maven.cli.MavenCli.main(MavenCli.java:197)
    at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
    at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
    at java.lang.reflect.Method.invoke(Method.java:606)
    at org.codehaus.plexus.classworlds.launcher.Launcher.launchEnhanced(Launcher.java:289)
    at org.codehaus.plexus.classworlds.launcher.Launcher.launch(Launcher.java:229)
    at org.codehaus.plexus.classworlds.launcher.Launcher.mainWithExitCode(Launcher.java:415)
    at org.codehaus.plexus.classworlds.launcher.Launcher.main(Launcher.java:356)
Caused by: org.apache.maven.plugin.MojoExecutionException: Cannot invoke Tomcat manager
    at org.apache.tomcat.maven.plugin.tomcat7.AbstractCatalinaMojo.execute(AbstractCatalinaMojo.java:141)
    at org.apache.tomcat.maven.plugin.tomcat7.AbstractWarCatalinaMojo.execute(AbstractWarCatalinaMojo.java:68)
    at org.apache.maven.plugin.DefaultBuildPluginManager.executeMojo(DefaultBuildPluginManager.java:134)
    at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:208)
    ... 20 more
Caused by: java.net.SocketException: Broken pipe
    at java.net.SocketOutputStream.socketWrite0(Native Method)
    at java.net.SocketOutputStream.socketWrite(SocketOutputStream.java:113)
    at java.net.SocketOutputStream.write(SocketOutputStream.java:159)
    at org.apache.http.impl.io.AbstractSessionOutputBuffer.write(AbstractSessionOutputBuffer.java:181)
    at org.apache.http.impl.io.ContentLengthOutputStream.write(ContentLengthOutputStream.java:115)
    at org.apache.tomcat.maven.common.deployer.TomcatManager$RequestEntityImplementation.writeTo(TomcatManager.java:880)
    at org.apache.http.entity.HttpEntityWrapper.writeTo(HttpEntityWrapper.java:89)
    at org.apache.http.impl.client.EntityEnclosingRequestWrapper$EntityWrapper.writeTo(EntityEnclosingRequestWrapper.java:108)
    at org.apache.http.impl.entity.EntitySerializer.serialize(EntitySerializer.java:117)
    at org.apache.http.impl.AbstractHttpClientConnection.sendRequestEntity(AbstractHttpClientConnection.java:265)
    at org.apache.http.impl.conn.ManagedClientConnectionImpl.sendRequestEntity(ManagedClientConnectionImpl.java:203)
    at org.apache.http.protocol.HttpRequestExecutor.doSendRequest(HttpRequestExecutor.java:236)
    at org.apache.http.protocol.HttpRequestExecutor.execute(HttpRequestExecutor.java:121)
    at org.apache.http.impl.client.DefaultRequestDirector.tryExecute(DefaultRequestDirector.java:682)
    at org.apache.http.impl.client.DefaultRequestDirector.execute(DefaultRequestDirector.java:486)
    at org.apache.http.impl.client.AbstractHttpClient.doExecute(AbstractHttpClient.java:863)
    at org.apache.http.impl.client.CloseableHttpClient.execute(CloseableHttpClient.java:82)
    at org.apache.tomcat.maven.common.deployer.TomcatManager.invoke(TomcatManager.java:742)
    at org.apache.tomcat.maven.common.deployer.TomcatManager.deployImpl(TomcatManager.java:705)
    at org.apache.tomcat.maven.common.deployer.TomcatManager.deploy(TomcatManager.java:388)
    at org.apache.tomcat.maven.plugin.tomcat7.deploy.AbstractDeployWarMojo.deployWar(AbstractDeployWarMojo.java:85)
    at org.apache.tomcat.maven.plugin.tomcat7.deploy.AbstractDeployMojo.invokeManager(AbstractDeployMojo.java:82)
    at org.apache.tomcat.maven.plugin.tomcat7.AbstractCatalinaMojo.execute(AbstractCatalinaMojo.java:132)
    ... 23 more

I can simply deploy the application going to the manager page of the server, the server is reachable... I can't understand what can be...我可以简单地将应用程序部署到服务器的管理器页面,服务器是可访问的......我无法理解什么可以......

I have the same problem, and solved now.我有同样的问题,现在解决了。 Just read this Tomcat deployement issue in a Maven project , by Belden Schroeder.只需阅读 Belden Schroeder 在 Maven 项目中的 Tomcat 部署问题

Ensure all of the following manager roles are added to your tomcat-users.xml.确保将以下所有管理员角色添加到您的 tomcat-users.xml。

<role rolename="manager-gui"/>
<role rolename="manager-script"/>
<role rolename="manager-jmx"/>
<role rolename="manager-status"/>
<user username="test1" password="test" roles="manager-script,manager-jmx" />

run: mvn tomcat7:deploy运行: mvn tomcat7:deploy

output :输出 :

[INFO] --- tomcat7-maven-plugin:2.2:deploy (default-cli) @ xx ---
[INFO] Deploying war to http://localhost:8080/xx  
Uploading: http://localhost:8080/manager/text/deploy?path=%2Fxx
Uploaded: http://localhost:8080/manager/text/deploy?path=%2Fxx (4801 KB at 25809.4 KB/sec)

the path should start with slash.路径应该以斜杠开头。

change改变

<path>webapp</path>

to

<path>/webapp</path>

检查本地配置文件中的tomcat端口或路径是否与远程tomcat一致

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 Tomcat7 maven 插件 - 处理请求时捕获 I/O 异常 (java.net.SocketException):管道损坏 - Tomcat7 maven plugin - I/O exception (java.net.SocketException) caught when processing request: Broken pipe 处理请求时捕获到 I/O 异常 (java.net.SocketException) - Getting I/O exception (java.net.SocketException) caught when processing request 连接到目标主机时捕获到I / O异常(java.net.SocketException):打开的文件太多 - I/O exception (java.net.SocketException) caught when connecting to the target host: Too many open files (java.net.SocketException) 在处理请求时被捕获:连接被对等重置:套接字写入错误 - (java.net.SocketException) caught when processing request: Connection reset by peer: socket write error java.net.SocketException:SMTP管道损坏 - java.net.SocketException: Broken pipe with SMTP java.net.SocketException:管道损坏 - java.net.SocketException: Broken pipe java.net.SocketException:管道损坏 - java.net.SocketException: Broken pipe java.net.SocketException:使用Quartz和MySQL以及Tomcat破坏管道(Tomcat崩溃) - java.net.SocketException: Broken pipe with Quartz and MySQL and Tomcat (Tomcat Crash) I / O异常 <java.net.SocketException> 在Solr启动中 - I/O exception <java.net.SocketException> in Solr startup java.net.SocketException有什么区别:Connection reset和java.net.SocketException:Broken Pipe? - What is the difference between java.net.SocketException: Connection reset and java.net.SocketException: Broken Pipe?
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM