3
respostas

Erro ao fazer o deploy automático do jenkins

Olá, fiz toda a configuração do meu job, porém, na hora de fazer o deploy do war para o tomcat dá o seguinte erro:

Deploying C:\Windows\system32\config\systemprofile.jenkins\jobs\TesteCI\workspace\target\TesteCI.war to container Tomcat 7.x Remote [C:\Windows\system32\config\systemprofile.jenkins\jobs\TesteCI\workspace\target\TesteCI.war] is not deployed. Doing a fresh deployment. Deploying [C:\Windows\system32\config\systemprofile.jenkins\jobs\TesteCI\workspace\target\TesteCI.war] ERROR: Build step failed with exception org.codehaus.cargo.container.ContainerException: Failed to deploy [C:\Windows\system32\config\systemprofile.jenkins\jobs\TesteCI\workspace\target\TesteCI.war] at org.codehaus.cargo.container.tomcat.internal.AbstractTomcatManagerDeployer.deploy(AbstractTomcatManagerDeployer.java:111) at org.codehaus.cargo.container.tomcat.internal.AbstractTomcatManagerDeployer.redeploy(AbstractTomcatManagerDeployer.java:185) at hudson.plugins.deploy.CargoContainerAdapter.deploy(CargoContainerAdapter.java:73) at hudson.plugins.deploy.CargoContainerAdapter$1.invoke(CargoContainerAdapter.java:116) at hudson.plugins.deploy.CargoContainerAdapter$1.invoke(CargoContainerAdapter.java:103) at hudson.FilePath.act(FilePath.java:996) at hudson.FilePath.act(FilePath.java:974) at hudson.plugins.deploy.CargoContainerAdapter.redeploy(CargoContainerAdapter.java:103) at hudson.plugins.deploy.DeployPublisher.perform(DeployPublisher.java:61) at hudson.tasks.BuildStepMonitor$3.perform(BuildStepMonitor.java:45) at hudson.model.AbstractBuild$AbstractBuildExecution.perform(AbstractBuild.java:779) at hudson.model.AbstractBuild$AbstractBuildExecution.performAllBuildSteps(AbstractBuild.java:720) at hudson.model.Build$BuildExecution.post2(Build.java:186) at hudson.model.AbstractBuild$AbstractBuildExecution.post(AbstractBuild.java:665) at hudson.model.Run.execute(Run.java:1753) at hudson.model.FreeStyleBuild.run(FreeStyleBuild.java:43) at hudson.model.ResourceController.execute(ResourceController.java:98) at hudson.model.Executor.run(Executor.java:405) 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:647) at org.codehaus.cargo.container.tomcat.internal.TomcatManager.invoke(TomcatManager.java:538) at org.codehaus.cargo.container.tomcat.internal.TomcatManager.deployImpl(TomcatManager.java:611) at org.codehaus.cargo.container.tomcat.internal.TomcatManager.deploy(TomcatManager.java:291) at org.codehaus.cargo.container.tomcat.internal.AbstractTomcatManagerDeployer.deploy(AbstractTomcatManagerDeployer.java:102) ... 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:647) at org.codehaus.cargo.container.tomcat.internal.TomcatManager.invoke(TomcatManager.java:538) at org.codehaus.cargo.container.tomcat.internal.TomcatManager.deployImpl(TomcatManager.java:611) at org.codehaus.cargo.container.tomcat.internal.TomcatManager.deploy(TomcatManager.java:291) at org.codehaus.cargo.container.tomcat.internal.AbstractTomcatManagerDeployer.deploy(AbstractTomcatManagerDeployer.java:102) at org.codehaus.cargo.container.tomcat.internal.AbstractTomcatManagerDeployer.redeploy(AbstractTomcatManagerDeployer.java:185) at hudson.plugins.deploy.CargoContainerAdapter.deploy(CargoContainerAdapter.java:73) at hudson.plugins.deploy.CargoContainerAdapter$1.invoke(CargoContainerAdapter.java:116) at hudson.plugins.deploy.CargoContainerAdapter$1.invoke(CargoContainerAdapter.java:103) at hudson.FilePath.act(FilePath.java:996) at hudson.FilePath.act(FilePath.java:974) at hudson.plugins.deploy.CargoContainerAdapter.redeploy(CargoContainerAdapter.java:103) at hudson.plugins.deploy.DeployPublisher.perform(DeployPublisher.java:61) at hudson.tasks.BuildStepMonitor$3.perform(BuildStepMonitor.java:45) at hudson.model.AbstractBuild$AbstractBuildExecution.perform(AbstractBuild.java:779) at hudson.model.AbstractBuild$AbstractBuildExecution.performAllBuildSteps(AbstractBuild.java:720) at hudson.model.Build$BuildExecution.post2(Build.java:186) at hudson.model.AbstractBuild$AbstractBuildExecution.post(AbstractBuild.java:665) at hudson.model.Run.execute(Run.java:1753) at hudson.model.FreeStyleBuild.run(FreeStyleBuild.java:43) at hudson.model.ResourceController.execute(ResourceController.java:98) at hudson.model.Executor.run(Executor.java:405) Build step 'Deploy war/ear to a container' marked build as failure Finished: FAILURE

O que poderia estar causando este erro?

3 respostas

Cara aparentemente ele não está conseguindo fazer a request para o tomcat.

Você consegue acessar o tomcat normalmente ?

Olá, eu tive o mesmo problema.

Analisando os logs percebi que o Tomcat esta tendo problema para realizar o undeploy e deletar a pasta do projeto dentro do webapps, então oque eu fiz foi iniciar o tomcat com cmd a nível administrador para evitar qualquer problema referente a permissão.

Se o seu ambiente for windows atualize o arquivo context.xml dentro de tomcat/conf na tag "Context" com o seguinte conteudo:

Espero ter ajudado, abs.

Olá Giovani, estou com o mesmo problema, o que eu deveria adicionar no Context.xml?

Grato!