I have been using Jenkins for quite some time for Continuous integration with my Java projects.

      Recently I tried the Jenkins Deploy Plugin (https://wiki.jenkins-ci.org/display/JENKINS/Deploy+Plugin) to deploy my war file on tomcat 7. However, I am unable to do so as I am getting the following error:

      Bug Stack Trace

      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)

      Thanks in advance

          [JENKINS-24096] Jenkins Tomcat deploymet error

          Thomas Hatley added a comment -

          I too ran into this issue when running IIS in front of Tomcat 7 - as a test, I opened an http port in Tomcat and bypassed IIS altogether using the new port, and that eliminated the error....next attempt at deployment from Jenkins was successful.

          Don't have a viable solution for those who must go through IIS, but I did see a post which mentioned 'chunking' of the PUT request as a potential cause.

          --------------------------------
          Jenkins v1.580.2
          Deploy to container Plugin v1.10

          Thomas Hatley added a comment - I too ran into this issue when running IIS in front of Tomcat 7 - as a test, I opened an http port in Tomcat and bypassed IIS altogether using the new port, and that eliminated the error....next attempt at deployment from Jenkins was successful. Don't have a viable solution for those who must go through IIS, but I did see a post which mentioned 'chunking' of the PUT request as a potential cause. -------------------------------- Jenkins v1.580.2 Deploy to container Plugin v1.10

          Charlie Hubbard added a comment - - edited

          I get this error once I try to redeploy the app. There doesn't seem to be a way to fix this without erasing the war and exploded directory then it will deploy without error. I find debugging this from looking at the output from the plugin is seriously obtuse. There is nothing printed out about what the server returned. The access logs on tomcat say a 200 success was returned, but nothing else. Just this obtuse exception with no real explanation. I also don't get any errors in the manager logs on tomcat. I feel like there could be a bug here, but because there is no actual error message it's impossible to tell what's really wrong.

          Actually I think you are experiencing the same thing. Notice this line:

          projs.war is not deployed. Doing a fresh deployment.

          I'm not sure why the plugin can't undeploy or redeploy, but it's not working. I've checked my logs and stopping the app should work, but I don't see it trying to stop it.

          Charlie Hubbard added a comment - - edited I get this error once I try to redeploy the app. There doesn't seem to be a way to fix this without erasing the war and exploded directory then it will deploy without error. I find debugging this from looking at the output from the plugin is seriously obtuse. There is nothing printed out about what the server returned. The access logs on tomcat say a 200 success was returned, but nothing else. Just this obtuse exception with no real explanation. I also don't get any errors in the manager logs on tomcat. I feel like there could be a bug here, but because there is no actual error message it's impossible to tell what's really wrong. Actually I think you are experiencing the same thing. Notice this line: projs.war is not deployed. Doing a fresh deployment. I'm not sure why the plugin can't undeploy or redeploy, but it's not working. I've checked my logs and stopping the app should work, but I don't see it trying to stop it.

          Robin Jansohn added a comment -

          Is this still an issue with the latest version 1.13?

          Robin Jansohn added a comment - Is this still an issue with the latest version 1.13?

          Robin Jansohn added a comment -

          Closing due to inactivity.

          Robin Jansohn added a comment - Closing due to inactivity.

            Unassigned Unassigned
            balwinder Balwinder Singh
            Votes:
            0 Vote for this issue
            Watchers:
            5 Start watching this issue

              Created:
              Updated:
              Resolved: