为什么Jenkins 1.598和tomcat 8自动部署不起作用

时间:2015-01-28 07:59:11

标签: tomcat jenkins

我有詹金斯1.598。我将自动部署插件安装到jenkins中(但它不适用于tomcat 8,还没有更新)。

一切正常!构建完成后,它开始重新部署。但有时我会有这样的错误,我不明白它何时以及为什么会发生。当我重新启动tomcat时,一切都再好了!

  Deploying C:\jenkins\test\target\tr-gui.war to container Tomcat 7.x Remote
      Redeploying [C:\jenkins\test\target\tr-gui.war]
      Undeploying [C:\jenkins\test\target\tr-gui.war]
    ERROR: Publisher hudson.plugins.deploy.DeployPublisher aborted due to exception
    org.codehaus.cargo.container.ContainerException: Failed to undeploy [C:\jenkins\test\target\tr-gui.war]
        at org.codehaus.cargo.container.tomcat.internal.AbstractTomcatManagerDeployer.undeploy(AbstractTomcatManagerDeployer.java:140)
        at org.codehaus.cargo.container.tomcat.internal.AbstractTomcatManagerDeployer.redeploy(AbstractTomcatManagerDeployer.java:178)
        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:981)
        at hudson.FilePath.act(FilePath.java:959)
        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:770)
        at hudson.model.AbstractBuild$AbstractBuildExecution.performAllBuildSteps(AbstractBuild.java:734)
        at hudson.model.Build$BuildExecution.post2(Build.java:183)
        at hudson.model.AbstractBuild$AbstractBuildExecution.post(AbstractBuild.java:683)
        at hudson.model.Run.execute(Run.java:1784)
        at hudson.model.FreeStyleBuild.run(FreeStyleBuild.java:43)
        at hudson.model.ResourceController.execute(ResourceController.java:89)
        at hudson.model.Executor.run(Executor.java:240)
    Caused by: org.codehaus.cargo.container.tomcat.internal.TomcatManagerException: FAIL - Unable to delete [C:\servers\tomcat 8\webapps\test]. The continued presence of this file may cause problems.

        at org.codehaus.cargo.container.tomcat.internal.TomcatManager.invoke(TomcatManager.java:566)
        at org.codehaus.cargo.container.tomcat.internal.TomcatManager.invoke(TomcatManager.java:480)
        at org.codehaus.cargo.container.tomcat.internal.TomcatManager.undeploy(TomcatManager.java:420)
        at org.codehaus.cargo.container.tomcat.Tomcat7xRemoteDeployer.performUndeploy(Tomcat7xRemoteDeployer.java:62)
        at org.codehaus.cargo.container.tomcat.internal.AbstractTomcatManagerDeployer.undeploy(AbstractTomcatManagerDeployer.java:130)
        ... 17 more
    org.codehaus.cargo.container.tomcat.internal.TomcatManagerException: FAIL - Unable to delete [C:\servers\tomcat 8\webapps\tr-gui]. The continued presence of this file may cause problems.

        at org.codehaus.cargo.container.tomcat.internal.TomcatManager.invoke(TomcatManager.java:566)
        at org.codehaus.cargo.container.tomcat.internal.TomcatManager.invoke(TomcatManager.java:480)
        at org.codehaus.cargo.container.tomcat.internal.TomcatManager.undeploy(TomcatManager.java:420)
        at org.codehaus.cargo.container.tomcat.Tomcat7xRemoteDeployer.performUndeploy(Tomcat7xRemoteDeployer.java:62)
        at org.codehaus.cargo.container.tomcat.internal.AbstractTomcatManagerDeployer.undeploy(AbstractTomcatManagerDeployer.java:130)
        at org.codehaus.cargo.container.tomcat.internal.AbstractTomcatManagerDeployer.redeploy(AbstractTomcatManagerDeployer.java:178)
        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:981)
        at hudson.FilePath.act(FilePath.java:959)
        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:770)
        at hudson.model.AbstractBuild$AbstractBuildExecution.performAllBuildSteps(AbstractBuild.java:734)
        at hudson.model.Build$BuildExecution.post2(Build.java:183)
        at hudson.model.AbstractBuild$AbstractBuildExecution.post(AbstractBuild.java:683)
        at hudson.model.Run.execute(Run.java:1784)
        at hudson.model.FreeStyleBuild.run(FreeStyleBuild.java:43)
        at hudson.model

.ResourceController.execute(ResourceController.java:89)
    at hudson.model.Executor.run(Executor.java:240)
Sending e-mails to:  test@mytest.com
Finished: FAILURE

1 个答案:

答案 0 :(得分:1)

我认为当时你的测试和tr-gui应用程序没有正确关闭。

这是Matt Mello(来自this bug report)的旧评论:

  

我遇到了同样的问题。

     

事实证明,我们的应用程序中有一个log4j appender设置要追加   到我们webapp目录中的HTML文件,显然是log4j会的   在我们正确关闭appender之前不要释放文件。   关闭应用程序是不够的。这可能是由于   事实上log4j本身是从tomcat而不是从应用程序加载的?   不确定。

     

无论如何,我在servlet destroy方法中添加了代码来清理   appenders,这确保文件被关闭,以便tomcat   可以删除目录。

     

[甚至不让我开始涉及我们所涉及的安全问题   在做。这是另一个话题。]

     

请注意,velocity也可能会将一些日志写入您的网络应用程序   目录。我相信我以前也看过这个。