当前位置: 首页 > 知识库问答 >
问题:

mvn tomcat7:部署-无法调用Tomcat管理器:破裂的管道

令狐晟
2023-03-14

[错误]无法执行目标组织。阿帕奇。公猫maven:tomcat7 maven插件:2.1:ProjectCliff上的部署(默认cli):无法调用Tomcat manager:Connection tohttp://localhost:8080拒绝:连接被拒绝

OS X 10.10.5 Apache Tomcat/8.0.24 JVM 1.8.0_05-b13

David-Laxers-MacBook-Pro:CLIFF davidlaxer$ mvn -version
Apache Maven 3.2.1 (ea8b2b07643dbb1b84b6d16e1f08391b666bc1e9; 2014-02-14T09:37:52-08:00)
Maven home: /Users/davidlaxer/Downloads/apache-maven-3.2.1
Java version: 1.8.0_05, vendor: Oracle Corporation
Java home: /Library/Java/JavaVirtualMachines/jdk1.8.0_05.jdk/Contents/Home/jre
Default locale: en_US, platform encoding: UTF-8
OS name: "mac os x", version: "10.10.5", arch: "x86_64", family: "mac"
David-Laxers-MacBook-Pro:CLIFF davidlaxer$ 


David-Laxers-MacBook-Pro:CLIFF davidlaxer$ sudo mvn tomcat7:deploy -DskipTests
[INFO] Scanning for projects...
[INFO] ------------------------------------------------------------------------
[INFO] Reactor Build Order:
[INFO] 
[INFO] CLIFF
[INFO] common
[INFO] stanford-entity-extractor
[INFO] cliff
[INFO] 
[INFO] Using the builder org.apache.maven.lifecycle.internal.builder.singlethreaded.SingleThreadedBuilder with a thread count of 1
[INFO]                                                                         
[INFO] ------------------------------------------------------------------------
[INFO] Building CLIFF 2.3.0
[INFO] ------------------------------------------------------------------------
[INFO] 
[INFO] >>> tomcat7-maven-plugin:2.1:deploy (default-cli) @ CLIFF >>>
[INFO] 
[INFO] <<< tomcat7-maven-plugin:2.1:deploy (default-cli) @ CLIFF <<<
[INFO] 
[INFO] --- tomcat7-maven-plugin:2.1:deploy (default-cli) @ CLIFF ---
[INFO] Skipping non-war project
[INFO]                                                                         
[INFO] ------------------------------------------------------------------------
[INFO] Building common 2.3.0
[INFO] ------------------------------------------------------------------------
[INFO] 
[INFO] >>> tomcat7-maven-plugin:2.1:deploy (default-cli) @ common >>>
[INFO] 
[INFO] --- maven-resources-plugin:2.6:resources (default-resources) @ common ---
[INFO] Using 'UTF-8' encoding to copy filtered resources.
[INFO] skip non existing resourceDirectory /Users/davidlaxer/CLIFF/common/src/main/resources
[INFO] 
[INFO] --- maven-compiler-plugin:3.1:compile (default-compile) @ common ---
[INFO] Nothing to compile - all classes are up to date
[INFO] 
[INFO] --- maven-resources-plugin:2.6:testResources (default-testResources) @ common ---
[INFO] Using 'UTF-8' encoding to copy filtered resources.
[INFO] skip non existing resourceDirectory /Users/davidlaxer/CLIFF/common/src/test/resources
[INFO] 
[INFO] --- maven-compiler-plugin:3.1:testCompile (default-testCompile) @ common ---
[INFO] No sources to compile
[INFO] 
[INFO] --- maven-surefire-plugin:2.16:test (default-test) @ common ---
[INFO] Tests are skipped.
[INFO] 
[INFO] --- maven-jar-plugin:2.4:jar (default-jar) @ common ---
[INFO] 
[INFO] <<< tomcat7-maven-plugin:2.1:deploy (default-cli) @ common <<<
[INFO] 
[INFO] --- tomcat7-maven-plugin:2.1:deploy (default-cli) @ common ---
[INFO] Skipping non-war project
[INFO]                                                                         
[INFO] ------------------------------------------------------------------------
[INFO] Building stanford-entity-extractor 2.3.0
[INFO] ------------------------------------------------------------------------
[INFO] 
[INFO] >>> tomcat7-maven-plugin:2.1:deploy (default-cli) @ stanford-entity-extractor >>>
[INFO] 
[INFO] --- maven-resources-plugin:2.6:resources (default-resources) @ stanford-entity-extractor ---
[INFO] Using 'UTF-8' encoding to copy filtered resources.
[INFO] Copying 14 resources
[INFO] 
[INFO] --- maven-compiler-plugin:3.1:compile (default-compile) @ stanford-entity-extractor ---
[INFO] Nothing to compile - all classes are up to date
[INFO] 
[INFO] --- maven-resources-plugin:2.6:testResources (default-testResources) @ stanford-entity-extractor ---
[INFO] Using 'UTF-8' encoding to copy filtered resources.
[INFO] Copying 23 resources
[INFO] 
[INFO] --- maven-compiler-plugin:3.1:testCompile (default-testCompile) @ stanford-entity-extractor ---
[INFO] Nothing to compile - all classes are up to date
[INFO] 
[INFO] --- maven-surefire-plugin:2.16:test (default-test) @ stanford-entity-extractor ---
[INFO] Tests are skipped.
[INFO] 
[INFO] --- maven-jar-plugin:2.4:jar (default-jar) @ stanford-entity-extractor ---
[INFO] 
[INFO] <<< tomcat7-maven-plugin:2.1:deploy (default-cli) @ stanford-entity-extractor <<<
[INFO] 
[INFO] --- tomcat7-maven-plugin:2.1:deploy (default-cli) @ stanford-entity-extractor ---
[INFO] Skipping non-war project
[INFO]                                                                         
[INFO] ------------------------------------------------------------------------
[INFO] Building cliff 2.3.0
[INFO] ------------------------------------------------------------------------
[INFO] 
[INFO] >>> tomcat7-maven-plugin:2.1:deploy (default-cli) @ cliff >>>
[INFO] 
[INFO] --- maven-resources-plugin:2.6:resources (default-resources) @ cliff ---
[INFO] Using 'UTF-8' encoding to copy filtered resources.
[INFO] Copying 12 resources
[INFO] 
[INFO] --- maven-compiler-plugin:3.1:compile (default-compile) @ cliff ---
[INFO] Nothing to compile - all classes are up to date
[INFO] 
[INFO] --- maven-resources-plugin:2.6:testResources (default-testResources) @ cliff ---
[INFO] Using 'UTF-8' encoding to copy filtered resources.
[INFO] skip non existing resourceDirectory /Users/davidlaxer/CLIFF/webapp/src/test/resources
[INFO] 
[INFO] --- maven-compiler-plugin:3.1:testCompile (default-testCompile) @ cliff ---
[INFO] No sources to compile
[INFO] 
[INFO] --- maven-surefire-plugin:2.16:test (default-test) @ cliff ---
[INFO] Tests are skipped.
[INFO] 
[INFO] --- maven-war-plugin:2.2:war (default-war) @ cliff ---
[INFO] Packaging webapp
[INFO] Assembling webapp [cliff] in [/Users/davidlaxer/CLIFF/webapp/target/cliff-2.3.0]
[INFO] Processing war project
[INFO] Copying webapp resources [/Users/davidlaxer/CLIFF/webapp/src/main/webapp]
[INFO] Webapp assembled in [1345 msecs]
[INFO] Building war: /Users/davidlaxer/CLIFF/webapp/target/cliff-2.3.0.war
[INFO] WEB-INF/web.xml already added, skipping
[INFO] 
[INFO] <<< tomcat7-maven-plugin:2.1:deploy (default-cli) @ cliff <<<
[INFO] 
[INFO] --- tomcat7-maven-plugin:2.1:deploy (default-cli) @ cliff ---
[INFO] Deploying war to http://localhost:8080/cliff-2.3.0  
[INFO] ------------------------------------------------------------------------
[INFO] Reactor Summary:
[INFO] 
[INFO] CLIFF ............................................. SUCCESS [  1.728 s]
[INFO] common ............................................ SUCCESS [  1.883 s]
[INFO] stanford-entity-extractor ......................... SUCCESS [  0.265 s]
[INFO] cliff ............................................. FAILURE [ 11.384 s]
[INFO] ------------------------------------------------------------------------
[INFO] BUILD FAILURE
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 15.717 s
[INFO] Finished at: 2015-08-26T08:07:32-08:00
[INFO] Final Memory: 12M/81M
[INFO] ------------------------------------------------------------------------
[ERROR] Failed to execute goal org.apache.tomcat.maven:tomcat7-maven-plugin:2.1:deploy (default-cli) on project cliff: Cannot invoke Tomcat manager: Connection to http://localhost:8080 refused: Connection refused -> [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/ConnectException
[ERROR] 
[ERROR] After correcting the problems, you can resume the build with the command
[ERROR]   mvn <goals> -rf :cliff

波姆。xml:

               <plugin>
                        <groupId>org.apache.tomcat.maven</groupId>
                        <artifactId>tomcat7-maven-plugin</artifactId>
                        <version>2.1</version>
                        <configuration>
                                <server>CliffTomcatServer</server>
                                <path>/${project.build.finalName}</path>
                        </configuration>
                </plugin>

~/.m2/设置。xml:

   <server>
      <id>CliffTomcatServer</id>
      <username>cliff</username>
      <password>beer</password>
    </server>

/usr/local/apache-tomcat-8.0.24/conftomcat_users.xml:

<tomcat-users>
<role rolename="manager"/>
  <role rolename="manager-gui"/>
  <role rolename="manager-script"/>
  <user username="cliff" password="beer" roles="manager,manager-gui,manager-script"/>

添加到pom.xlm:http://localhost:8080/manager/text

[INFO] Deploying war to http://localhost:8080/cliff-2.3.0  
Uploading: http://localhost:8080/manager/text/deploy?path=%2Fcliff-2.3.0
2052/127150 KB   
[INFO] I/O exception (java.net.SocketException) caught when processing request: Broken pipe
[INFO] Retrying request
Uploading: http://localhost:8080/manager/text/deploy?path=%2Fcliff-2.3.0
2356/127150 KB   
[INFO] I/O exception (java.net.SocketException) caught when processing request: Broken pipe
[INFO] Retrying request
Uploading: http://localhost:8080/manager/text/deploy?path=%2Fcliff-2.3.0
2052/127150 KB   
[INFO] I/O exception (java.net.SocketException) caught when processing request: Broken pipe
[INFO] Retrying request
Uploading: http://localhost:8080/manager/text/deploy?path=%2Fcliff-2.3.0
2156/127150 KB   
[INFO] ------------------------------------------------------------------------
[INFO] Reactor Summary:
[INFO] 
[INFO] CLIFF ............................................. SUCCESS [  1.523 s]
[INFO] common ............................................ SUCCESS [  1.718 s]
[INFO] stanford-entity-extractor ......................... SUCCESS [  0.359 s]
[INFO] cliff ............................................. FAILURE [ 12.664 s]
[INFO] ------------------------------------------------------------------------
[INFO] BUILD FAILURE
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 16.735 s
[INFO] Finished at: 2015-08-26T11:04:23-08:00
[INFO] Final Memory: 12M/81M
[INFO] ------------------------------------------------------------------------
[ERROR] Failed to execute goal org.apache.tomcat.maven:tomcat7-maven-plugin:2.1:deploy (default-cli) on project cliff: Cannot invoke Tomcat manager: Broken pipe -> [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
[ERROR] 
[ERROR] After correcting the problems, you can resume the build with the command
[ERROR]   mvn <goals> -rf :cliff
David-Laxers-MacBook-Pro:CLIFF davidlaxer$ 

共有3个答案

司徒光霁
2023-03-14

你可能需要加上这个

<configuration>
   ..
   <update>true</update>
   ..
</configuration>

给你的pom。要运行的xml文件

mvn tomcat7:deploy
廉飞捷
2023-03-14

在 /manager/text上部署的角色是“管理器脚本”,Apache Tomcat Manager How-To指示不应将其应用于具有管理器图形用户界面角色的用户。我使用的部署用户只有管理器脚本角色,没有其他角色,并且上传WAR文件时没有中断管道消息。如果我将管理器图形用户界面角色添加到我的部署用户中,我将收到您遇到的中断管道消息。尝试更改tomcat-users.xml,将克里夫的角色限制为单个管理器脚本角色。希望有所帮助。

http://tomcat.apache.org/tomcat-7.0-doc/manager-howto.html

巫健柏
2023-03-14

当我设置~/. m2/settings.xml时,它不起作用。所以我设置pom.xml,像这样:

<plugin>
    <groupId>org.apache.tomcat.maven</groupId>
    <artifactId>tomcat7-maven-plugin</artifactId>
    <version>${tomcat7-maven-plugin.version}</version>
    <configuration>
        <url>http://localhost:8080/manager/text</url>
        <server>tomcat</server>
        <username>admin1</username>
        <password>admin1</password>
        <path>/${project.artifactId}</path>
        <update>true</update>
     </configuration>
</plugin>

以及$CATALINA_HOME/conf/tomcat用户。xml文件,在

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

那对我来说就行了。:)

 类似资料:
  • 我无法使用Tomcat Manager部署war文件 我的\Tomcat\conf\tomcat-users.xml如下所示: 另外,在localhost-config\tomcat-users.xml处编辑\servers\tomcat V7.0服务器,以 注意:我正在重新启动服务器,http://localhost:8080/不工作

  • 我有一个非常奇怪的问题,我希望你的眼睛能帮助解决它。 我定义了一个函数,它通过BASH连接到Oracle SQL数据库。连接后,我使用一个herdeoc传入一个简单的select语句,该语句查找最大订阅id并递增它,具体取决于函数被调用的次数。代码如下: 在命令行调用函数时,上述代码非常有效: 但是,当函数通过管道传输到AWK语句时,函数不再抖动,这毫无意义!请参阅下面的输出: 我不明白。哈哈,我

  • 我在tomcat7上使用Solr 4.3。当并发写入和读取的数量增加时,会引发此SocketException错误。我通过多个客户端进行并发提交和搜索。感谢您的任何帮助。这是tomcat日志(catalina.out)和solr。日志

  • 我正在对一个由zuul代理服务支持的简单Spring云应用程序进行一些压力测试。由于Zuul和服务之间的旧连接,我们偶尔会出现管道异常。我使用不同的配置选项配置Zuul,但没有成功: 例外情况如下: 通用域名格式。netflix。祖尔。例外ZuulException:组织转发错误。springframework。云netflix。祖尔。过滤器。路线RibbonRoutingFilter。转发(Ri

  • 我们将我们的集群迁移到Cassandra 1.2(从1.1.7),并尝试在迁移后运行修复(我们按照建议定期运行它们)。 由于SSTable版本不同,修复失败,因此我们使用和并重试。 但是,修复失败了,但有这个例外: 我们还注意到,在死亡之前,< code>nodetool netstats显示了奇怪的统计数据(表传输为756845%...). 编辑 这似乎是压缩SSTables传输的问题,我将尝试

  • 我正在实现与Android应用程序通信的服务器端应用程序。Android应用程序在最初与C服务器通信之前就已经实现了。现在我想用java代码替换C服务器。Android应用程序与服务器进行通信,通过读卡器中的卡对此人进行身份验证。 身份验证协议包含应用程序和服务器之间要成功完成的几个通信步骤。 应用程序和服务器之间的消息格式如下: 首先,应用程序发送一个类型1的请求来建立与读卡器中sim卡的连接。