2014-04-11 125 views
4

我一直在使用Jenkins很長一段時間來持續集成Java項目。Jenkins Tomcat部署錯誤

最近我嘗試了詹金斯部署插件(https://wiki.jenkins-ci.org/display/JENKINS/Deploy+Plugin)部署我的war文件在Tomcat 7。但是,我不能這樣做,因爲我收到以下錯誤:

Deploying C:\Program Files (x86)\Jenkins\jobs\MY_PROJS\workspace\target\projs.war to container Tomcat 7.x Remote 
     [C:\Program Files (x86)\Jenkins\jobs\MY_PROJS\workspace\target\projs.war] is not deployed. Doing a fresh deployment. 
     Deploying [C:\Program Files (x86)\Jenkins\jobs\MY_PROJS\workspace\target\projs.war] 
    ERROR: Publisher hudson.plugins.deploy.DeployPublisher aborted due to exception 
    org.codehaus.cargo.container.ContainerException: Failed to deploy [C:\Program Files (x86)\Jenkins\jobs\MY_PROJS\workspace\target\projs.war] 
     at org.codehaus.cargo.container.tomcat.internal.AbstractTomcatManagerDeployer.deploy(AbstractTomcatManagerDeployer.java:115) 
     at org.codehaus.cargo.container.tomcat.internal.AbstractTomcatManagerDeployer.redeploy(AbstractTomcatManagerDeployer.java:187) 
     at hudson.plugins.deploy.CargoContainerAdapter.deploy(CargoContainerAdapter.java:64) 
     at hudson.plugins.deploy.CargoContainerAdapter$1.invoke(CargoContainerAdapter.java:90) 
     at hudson.plugins.deploy.CargoContainerAdapter$1.invoke(CargoContainerAdapter.java:77) 
     at hudson.FilePath.act(FilePath.java:914) 
     at hudson.FilePath.act(FilePath.java:887) 
     at hudson.plugins.deploy.CargoContainerAdapter.redeploy(CargoContainerAdapter.java:77) 
     at hudson.plugins.deploy.DeployPublisher.perform(DeployPublisher.java:47) 
     at hudson.tasks.BuildStepMonitor$3.perform(BuildStepMonitor.java:45) 
     at hudson.model.AbstractBuild$AbstractBuildExecution.perform(AbstractBuild.java:804) 
     at hudson.model.AbstractBuild$AbstractBuildExecution.performAllBuildSteps(AbstractBuild.java:776) 
     at hudson.maven.MavenModuleSetBuild$MavenModuleSetBuildExecution.post2(MavenModuleSetBuild.java:1030) 
     at hudson.model.AbstractBuild$AbstractBuildExecution.post(AbstractBuild.java:725) 
     at hudson.model.Run.execute(Run.java:1695) 
     at hudson.maven.MavenModuleSetBuild.run(MavenModuleSetBuild.java:519) 
     at hudson.model.ResourceController.execute(ResourceController.java:88) 
     at hudson.model.Executor.run(Executor.java:231) 
    Caused by: java.io.IOException: Error writing request body to server 
     at sun.net.www.protocol.http.HttpURLConnection$StreamingOutputStream.checkError(Unknown Source) 
     at sun.net.www.protocol.http.HttpURLConnection$StreamingOutputStream.write(Unknown Source) 
     at java.io.BufferedOutputStream.flushBuffer(Unknown Source) 
     at java.io.BufferedOutputStream.write(Unknown Source) 
     at org.codehaus.cargo.container.tomcat.internal.TomcatManager.pipe(TomcatManager.java:583) 
     at org.codehaus.cargo.container.tomcat.internal.TomcatManager.invoke(TomcatManager.java:501) 
     at org.codehaus.cargo.container.tomcat.internal.TomcatManager.deployImpl(TomcatManager.java:547) 
     at org.codehaus.cargo.container.tomcat.internal.TomcatManager.deploy(TomcatManager.java:273) 
     at org.codehaus.cargo.container.tomcat.internal.TomcatManager.deploy(TomcatManager.java:256) 
     at org.codehaus.cargo.container.tomcat.internal.TomcatManager.deploy(TomcatManager.java:240) 
     at org.codehaus.cargo.container.tomcat.internal.AbstractTomcatManagerDeployer.deploy(AbstractTomcatManagerDeployer.java:107) 
     ... 17 more 
    java.io.IOException: Error writing request body to server 
     at sun.net.www.protocol.http.HttpURLConnection$StreamingOutputStream.checkError(Unknown Source) 
     at sun.net.www.protocol.http.HttpURLConnection$StreamingOutputStream.write(Unknown Source) 
     at java.io.BufferedOutputStream.flushBuffer(Unknown Source) 
     at java.io.BufferedOutputStream.write(Unknown Source) 
     at org.codehaus.cargo.container.tomcat.internal.TomcatManager.pipe(TomcatManager.java:583) 
     at org.codehaus.cargo.container.tomcat.internal.TomcatManager.invoke(TomcatManager.java:501) 
     at org.codehaus.cargo.container.tomcat.internal.TomcatManager.deployImpl(TomcatManager.java:547) 
     at org.codehaus.cargo.container.tomcat.internal.TomcatManager.deploy(TomcatManager.java:273) 
     at org.codehaus.cargo.container.tomcat.internal.TomcatManager.deploy(TomcatManager.java:256) 
     at org.codehaus.cargo.container.tomcat.internal.TomcatManager.deploy(TomcatManager.java:240) 
     at org.codehaus.cargo.container.tomcat.internal.AbstractTomcatManagerDeployer.deploy(AbstractTomcatManagerDeployer.java:107) 
     at org.codehaus.cargo.container.tomcat.internal.AbstractTomcatManagerDeployer.redeploy(AbstractTomcatManagerDeployer.java:187) 
     at hudson.plugins.deploy.CargoContainerAdapter.deploy(CargoContainerAdapter.java:64) 
     at hudson.plugins.deploy.CargoContainerAdapter$1.invoke(CargoContainerAdapter.java:90) 
     at hudson.plugins.deploy.CargoContainerAdapter$1.invoke(CargoContainerAdapter.java:77) 
     at hudson.FilePath.act(FilePath.java:914) 
     at hudson.FilePath.act(FilePath.java:887) 
     at hudson.plugins.deploy.CargoContainerAdapter.redeploy(CargoContainerAdapter.java:77) 
     at hudson.plugins.deploy.DeployPublisher.perform(DeployPublisher.java:47) 
     at hudson.tasks.BuildStepMonitor$3.perform(BuildStepMonitor.java:45) 
     at hudson.model.AbstractBuild$AbstractBuildExecution.perform(AbstractBuild.java:804) 
     at hudson.model.AbstractBuild$AbstractBuildExecution.performAllBuildSteps(AbstractBuild.java:776) 
     at hudson.maven.MavenModuleSetBuild$MavenModuleSetBuildExecution.post2(MavenModuleSetBuild.java:1030) 
     at hudson.model.AbstractBuild$AbstractBuildExecution.post(AbstractBuild.java:725) 
     at hudson.model.Run.execute(Run.java:1695) 
     at hudson.maven.MavenModuleSetBuild.run(MavenModuleSetBuild.java:519) 
     at hudson.model.ResourceController.execute(ResourceController.java:88) 
     at hudson.model.Executor.run(Executor.java:231) 

預先感謝你的幫助。

+0

仍然在等待答案:( –

+0

我也有這個問題,似乎與正在部署的版本有關,如果應用程序的版本相同,它可以正常工作,但如果它是不同的版本,則會失敗並顯示此錯誤。我認爲更改web.xml中的顯示名稱可以解決它,但似乎並沒有。 – Randyaa

回答

0

在大多數情況下,像這樣的錯誤只是由URL參數不正確引起的。

看到類似的問題記錄/解決here其中URL參數是罪魁禍首。此外,我強烈建議全面覆蓋Apache Manager Documentation

但是,如上面comment中所述,這也可能是由應用程序本身與實際部署之間的版本不匹配造成的。