Jenkins部署异常:TomcatManagerException: FAIL - Unable to delete

简介: Jenkins部署异常:TomcatManagerException: FAIL - Unable to delete

Jenkins相关文章

1.Jenkins安装(Linux版)

2.Jenkins:从SVN拉取Maven项目

3.Jenkins:从SVN拉取Maven项目,部署Tomcat(Deploy to container)

4.Jenkins部署异常: java.io.FileNotFoundException: http://ip:端口/manager/text/list

5.Jenkins部署异常:The Tomcat Manager responded FAIL - Deployed application at context path


异常现象


org.codehaus.cargo.container.tomcat.internal.TomcatManagerException: FAIL - Unable to delete [/usr/local/java/apache-tomcat-8080-h5/Cloud]. 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)


异常原因


  • Tomcat应用更新时,把新的WAR包放到webapps目录下,Tomcat就会自动把原来的同名webapp删除,并把WAR包解压,运行新的 webapp。
  • 但是,有时候Tomcat并不能把旧的webapp完全删除,通常会留下WEB-INF/lib下的某个jar包,必须关闭Tomcat才能删除,这就导致自动部署失败
  • 解决方法是在<Context>元素中增加一个属性antiResourceLocking="true" antiJARLocking="true",默认是"false"。这样就可以热部署了。
  • 实际上,这两个参数就是配置Tomcat的资源锁定和Jar包锁定策略


异常解决


  • 打开TOMCAT_HOME/conf/context.xml
  • 在<Context>元素中增加一个属性antiResourceLocking="true" antiJARLocking="true",默认是"false"。
<?xml version='1.0' encoding='utf-8'?>
<!--
  Licensed to the Apache Software Foundation (ASF) under one or more
  contributor license agreements.  See the NOTICE file distributed with
  this work for additional information regarding copyright ownership.
  The ASF licenses this file to You under the Apache License, Version 2.0
  (the "License"); you may not use this file except in compliance with
  the License.  You may obtain a copy of the License at
      http://www.apache.org/licenses/LICENSE-2.0
  Unless required by applicable law or agreed to in writing, software
  distributed under the License is distributed on an "AS IS" BASIS,
  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  See the License for the specific language governing permissions and
  limitations under the License.
-->
<!-- The contents of this file will be loaded for each web application -->
<Context antiResourceLocking="true" antiJARLocking="true">  
    <!-- Default set of monitored resources. If one of these changes, the    -->
    <!-- web application will be reloaded.                                   -->
    <WatchedResource>WEB-INF/web.xml</WatchedResource>
    <WatchedResource>${catalina.base}/conf/web.xml</WatchedResource>
    <!-- Uncomment this to disable session persistence across Tomcat restarts -->
    <!--
    <Manager pathname="" />
    -->
    <!-- Uncomment this to enable Comet connection tacking (provides events
         on session expiration as well as webapp lifecycle) -->
    <!--
    <Valve className="org.apache.catalina.valves.CometConnectionManagerValve" />
    -->
</Context>





目录
相关文章
|
9天前
|
运维 jenkins Java
Jenkins 自动化局域网管控软件构建与部署流程
在企业局域网管理中,Jenkins 作为自动化工具,通过配置源码管理、构建及部署步骤,实现了高效、稳定的软件开发与部署流程,显著提升局域网管控软件的开发与运维效率。
24 5
|
5月前
|
jenkins Java 测试技术
实现基于Jenkins的持续集成与部署
实现基于Jenkins的持续集成与部署
|
2月前
|
jenkins Java 持续交付
Jenkins打包,发布,部署
Jenkins打包,发布,部署
239 0
|
4月前
|
Kubernetes jenkins 持续交付
jenkins学习笔记之二十一:k8s部署jenkins及动态slave
jenkins学习笔记之二十一:k8s部署jenkins及动态slave
|
4月前
|
jenkins 持续交付 开发工具
"引爆效率革命!Docker+Jenkins+GIT+Tomcat:解锁持续集成魔法,一键部署Java Web应用的梦幻之旅!"
【8月更文挑战第9天】随着软件开发复杂度的增加,自动化变得至关重要。本文通过实例展示如何结合Docker、Jenkins、Git与Tomcat建立高效的持续集成(CI)流程。Docker确保应用环境一致性;Jenkins自动化处理构建、测试和部署;Git管理源代码版本;Tomcat部署Web应用。在Jenkins中配置Git插件并设置项目,集成Docker构建Tomcat应用镜像并运行容器。此外,通过自动化测试、代码质量检查、环境隔离和日志监控确保CI流程顺畅,从而显著提高开发效率和软件质量。
81 3
|
4月前
|
jenkins Java 持续交付
【一键搞定!】Jenkins 自动发布 Java 代码的神奇之旅 —— 从零到英雄的持续集成/部署实战秘籍!
【8月更文挑战第9天】随着软件开发自动化的发展,持续集成(CI)与持续部署(CD)已成为现代流程的核心。Jenkins 作为一款灵活且功能丰富的开源 CI/CD 工具,在业界应用广泛。以一家电商公司的 Java 后端服务为例,通过搭建 Jenkins 自动化发布流程,包括创建 Jenkins 项目、配置 Git 仓库、设置构建触发器以及编写构建脚本等步骤,可以实现代码的快速可靠部署。
166 2
|
4月前
|
负载均衡 jenkins 应用服务中间件
大规模部署下的 Jenkins 高可用性与负载均衡
【8月更文第31天】随着软件开发流程的加速,持续集成/持续交付(CI/CD)工具的重要性日益凸显。Jenkins 作为最受欢迎的 CI/CD 平台之一,为企业提供了强大的自动化构建和部署功能。然而,在大规模部署场景下,单一的 Jenkins 实例可能无法满足高可用性和性能的需求。本文将探讨如何设计和实施 Jenkins 高可用集群,以支持大型组织的需求,并通过负载均衡技术来提高系统的稳定性和响应速度。
300 0
|
4月前
|
jenkins Java 关系型数据库
jenkins学习笔记之十二:sonarqube9.9、SonarScanner4.8部署
jenkins学习笔记之十二:sonarqube9.9、SonarScanner4.8部署
|
5月前
|
Kubernetes jenkins 持续交付
Jenkins部署以及基本使用
Jenkins部署以及基本使用
184 7
|
4月前
|
jenkins 持续交付 网络安全
Jenkins——使用Docker部署Jenkins详解
Jenkins——使用Docker部署Jenkins详解
277 0