Deploying artifacts to Tomcat will sometimes fail on due to file locking

お困りですか?

アトラシアン コミュニティをご利用ください。

コミュニティに質問

When a plan is configured to use Deploy Tomcat application task to deploy the generated artifacts to Tomcat (as explained here - Using Tomcat with Bamboo for continuous deployment) and if it sometimes fails with the below error in the build logs:

Starting task 'Deploy test' of type 'com.atlassian.bamboo.plugins.tomcat.bamboo-tomcat-plugin:deployAppTask'
Deploying application with war file 'test.war' to context '/hello' to server 'http://localhost:8080/manager/'
Application failed to deploy: FAIL - Unable to delete [D:\Program Files\Apache Software Foundation\Tomcat 7.0\webapps\hello]. The continued presence of this file may cause problems.
FAIL - Application already exists at path /hello

原因

This is more common in Windows OS where Tomcat will lock files or directory location. In most cases this happens after the first succesfull deployment and subsequent ones will be blocked. Even though this is more common in Windows, it might affect the linux OS as well and the same resolution should be applied on both.

ソリューション

This can be fixed by  adding <Context antiResourceLocking="true"> to Tomcat context. The  antiResourceLocking is by default set to false. More details can be read at http://tomcat.apache.org/tomcat-5.5-doc/config/context.html .

Last modified on Mar 15, 2022

この内容はお役に立ちましたか?

はい
いいえ
この記事についてのフィードバックを送信する
Powered by Confluence and Scroll Viewport.