0

我正在使用tomcat7-maven-plugin将应用程序部署到远程服务器

1-插件配置:

         <plugin>
            <groupId>org.apache.tomcat.maven</groupId>
            <artifactId>tomcat7-maven-plugin</artifactId>
            <version>2.0-beta-1</version>
            <configuration>
              <server>pb</server>
              <url>http://mydomain:8080/manager/html</url>
            </configuration>
        </plugin>

2-settings.xml:

<settings xmlns="http://maven.apache.org/SETTINGS/1.0.0"
  xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
  xsi:schemaLocation="http://maven.apache.org/SETTINGS/1.0.0
                      http://maven.apache.org/xsd/settings-1.0.0.xsd">


  <servers>
  <server>
        <id>pb</id>
        <username>myuser</username>
        <password>mypass</password>
  </server>
  </servers>

</settings>

我正在使用命令:mvn tomcat7:deploy

我可以看到部署了war文件:

[INFO] Deploying war to http://mydomain.com:8080/myapp
Uploading: http://mydomain.com:8080/manager/html/deploy?path=%2Fmyapp
Uploaded: http://mydomain.com:8080/manager/html/deploy?path=%2Fmyapp (5932 KB at 18.9 KB/sec)

之后我收到错误:

Cannot invoke Tomcat manager:Cannot retry request with a non-repeatable request entity. 

请告知我为什么会收到此错误,以及如何解决它。

详细异常:

org.apache.maven.lifecycle.LifecycleExecutionException: Cannot invoke Tomcat manager
        at org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoals(DefaultLifecycleExecutor.java:719)
        at org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeStandaloneGoal(DefaultLifecycleExecutor.java:569)
        at org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoal(DefaultLifecycleExecutor.java:539)
        at org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoalAndHandleFailures(DefaultLifecycleExecutor.java:387)
        at org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeTaskSegments(DefaultLifecycleExecutor.java:348)
        at org.apache.maven.lifecycle.DefaultLifecycleExecutor.execute(DefaultLifecycleExecutor.java:180)
        at org.apache.maven.DefaultMaven.doExecute(DefaultMaven.java:328)
        at org.apache.maven.DefaultMaven.execute(DefaultMaven.java:138)
        at org.apache.maven.cli.MavenCli.main(MavenCli.java:362)
        at org.apache.maven.cli.compat.CompatibleMain.main(CompatibleMain.java:60)
        at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
        at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
        at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
        at java.lang.reflect.Method.invoke(Method.java:597)
        at org.codehaus.classworlds.Launcher.launchEnhanced(Launcher.java:315)
        at org.codehaus.classworlds.Launcher.launch(Launcher.java:255)
        at org.codehaus.classworlds.Launcher.mainWithExitCode(Launcher.java:430)
        at org.codehaus.classworlds.Launcher.main(Launcher.java:375)
Caused by: org.apache.maven.plugin.MojoExecutionException: Cannot invoke Tomcat manager
        at org.apache.tomcat.maven.plugin.tomcat7.AbstractCatalinaMojo.execute(AbstractCatalinaMojo.java:152)
        at org.apache.tomcat.maven.plugin.tomcat7.AbstractWarCatalinaMojo.execute(AbstractWarCatalinaMojo.java:71)
        at org.apache.maven.plugin.DefaultPluginManager.executeMojo(DefaultPluginManager.java:490)
        at org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoals(DefaultLifecycleExecutor.java:694)
        ... 17 more
Caused by: org.apache.http.client.ClientProtocolException
        at org.apache.http.impl.client.AbstractHttpClient.execute(AbstractHttpClient.java:926)
        at org.apache.http.impl.client.AbstractHttpClient.execute(AbstractHttpClient.java:822)
        at org.apache.tomcat.maven.common.deployer.TomcatManager.invoke(TomcatManager.java:718)
        at org.apache.tomcat.maven.common.deployer.TomcatManager.deployImpl(TomcatManager.java:681)
        at org.apache.tomcat.maven.common.deployer.TomcatManager.deploy(TomcatManager.java:363)
        at org.apache.tomcat.maven.plugin.tomcat7.deploy.AbstractDeployWarMojo.deployWar(AbstractDeployWarMojo.java:88)
        at org.apache.tomcat.maven.plugin.tomcat7.deploy.AbstractDeployMojo.invokeManager(AbstractDeployMojo.java:87)
        at org.apache.tomcat.maven.plugin.tomcat7.AbstractCatalinaMojo.execute(AbstractCatalinaMojo.java:143)
        ... 20 more
Caused by: org.apache.http.client.NonRepeatableRequestException: Cannot retry request with a non-repeatable request entity.
        at org.apache.http.impl.client.DefaultRequestDirector.tryExecute(DefaultRequestDirector.java:686)
        at org.apache.http.impl.client.DefaultRequestDirector.execute(DefaultRequestDirector.java:515)
        at org.apache.http.impl.client.AbstractHttpClient.execute(AbstractHttpClient.java:923)
4

1 回答 1

1

是的,这是 2.0-beta-1 版本的问题。请参阅https://issues.apache.org/jira/browse/MTOMCAT-116 您可以尝试 2.0-SNAPSHOT 版本来测试修复。

于 2012-07-01T07:26:03.653 回答