如果已部署,Jenkins自动部署程序无法在tomcat中部署

时间:2016-02-02 07:00:18

标签: tomcat jenkins deployment

我正在使用部署插件在Tomcat 7中自动部署war。当tomcat中尚未部署war文件时,它可以正常工作。如果我第二次构建我的项目以在tomcat上部署它会引发异常。

在新部署期间

Build step 'Invoke Gradle script' changed build result to SUCCESS
Deploying /root/.jenkins/workspace/CSB-CityAgent-csbPlatformApp/Workspace/Application/csbClient/CityAgent/csbPlatformApp/war/libs/csbPlatformApp.war to container Tomcat 7.x Remote
  [/root/.jenkins/workspace/CSB-CityAgent-csbPlatformApp/Workspace/Application/csbClient/CityAgent/csbPlatformApp/war/libs/csbPlatformApp.war] is not deployed. Doing a fresh deployment.
  Deploying [/root/.jenkins/workspace/CSB-CityAgent-csbPlatformApp/Workspace/Application/csbClient/CityAgent/csbPlatformApp/war/libs/csbPlatformApp.war]
Finished: SUCCESS

当我第二次尝试时,

Build step 'Invoke Gradle script' changed build result to SUCCESS
Deploying /root/.jenkins/workspace/CSB-CityAgent-csbPlatformApp/Workspace/Application/csbClient/CityAgent/csbPlatformApp/war/libs/csbPlatformApp.war to container Tomcat 7.x Remote
  Redeploying [/root/.jenkins/workspace/CSB-CityAgent-csbPlatformApp/Workspace/Application/csbClient/CityAgent/csbPlatformApp/war/libs/csbPlatformApp.war]
  Undeploying [/root/.jenkins/workspace/CSB-CityAgent-csbPlatformApp/Workspace/Application/csbClient/CityAgent/csbPlatformApp/war/libs/csbPlatformApp.war]
  Deploying [/root/.jenkins/workspace/CSB-CityAgent-csbPlatformApp/Workspace/Application/csbClient/CityAgent/csbPlatformApp/war/libs/csbPlatformApp.war]
ERROR: Build step failed with exception
org.codehaus.cargo.container.ContainerException: Failed to deploy [/root/.jenkins/workspace/CSB-CityAgent-csbPlatformApp/Workspace/Application/csbClient/CityAgent/csbPlatformApp/war/libs/csbPlatformApp.war]
    at org.codehaus.cargo.container.tomcat.internal.AbstractTomcatManagerDeployer.deploy(AbstractTomcatManagerDeployer.java:107)
    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:991)
    at hudson.FilePath.act(FilePath.java:969)
    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:726)
    at hudson.model.Build$BuildExecution.post2(Build.java:185)
    at hudson.model.AbstractBuild$AbstractBuildExecution.post(AbstractBuild.java:671)
    at hudson.model.Run.execute(Run.java:1766)
    at hudson.model.FreeStyleBuild.run(FreeStyleBuild.java:43)
    at hudson.model.ResourceController.execute(ResourceController.java:98)
    at hudson.model.Executor.run(Executor.java:408)
Caused by: org.codehaus.cargo.container.tomcat.internal.TomcatManagerException: FAIL - Encountered exception javax.management.RuntimeErrorException: Error invoking method check

    at org.codehaus.cargo.container.tomcat.internal.TomcatManager.invoke(TomcatManager.java:566)
    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
org.codehaus.cargo.container.tomcat.internal.TomcatManagerException: FAIL - Encountered exception javax.management.RuntimeErrorException: Error invoking method check

    at org.codehaus.cargo.container.tomcat.internal.TomcatManager.invoke(TomcatManager.java:566)
    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:991)
    at hudson.FilePath.act(FilePath.java:969)
    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:726)
    at hudson.model.Build$BuildExecution.post2(Build.java:185)
    at hudson.model.AbstractBuild$AbstractBuildExecution.post(AbstractBuild.java:671)
    at hudson.model.Run.execute(Run.java:1766)
    at hudson.model.FreeStyleBuild.run(FreeStyleBuild.java:43)
    at hudson.model.ResourceController.execute(ResourceController.java:98)
    at hudson.model.Executor.run(Executor.java:408)
Build step 'Deploy war/ear to a container' marked build as failure
Finished: FAILURE

我的配置,

enter image description here

我无法弄清楚问题。任何人都可以帮助我吗?

1 个答案:

答案 0 :(得分:0)

我遇到了同样的问题,

在日志中找到了

java.lang.OutOfMemoryError: Compressed class space

解决方案是在tomcat / bin / setenv中的JAVA_OPTS中添加-XX:CompressedClassSpaceSize = XXXm

注意:我使用的是Tomcat 8