且构网

分享程序员开发的那些事...
且构网 - 分享程序员编程开发的那些事

取消部署 Tomcat Web 应用程序时如何防止文件锁定?

更新时间:2023-11-14 18:52:22

这在 Windows 环境中很常见,但是通过 antiResourceLocking 上下文属性:

从/tomcat/conf 文件夹打开 context.xml 并修改上下文以匹配此:

在@JanM 评论之后更新了属性.以前它也包含'antiJARLocking'

I am using the manager app in tomcat 7, and i am unable to undeploy an application completely.

It says FAIL - Unable to delete [F:apache-tomcat-7.0.33webappsalaji]. The continued presence of this file may cause problems.

I read somewhere its because of some phenomenon called memory leak , and if we fix it the issue will be solved.

Can anyone tell me what is this memory leak in tomcat 7, and how can we fix it ?? I am using windows 7 OS. If i am able to fix it will my un-deploy and re-deploy process run smooth ?

This is very common in Windows environment but there is a solution via the antiResourceLocking context property:

Open context.xml from /tomcat/conf folder and modify the context to match this :

<Context antiResourceLocking="true">

Edit: Updated properties following @JanM comment. Previously it also contained 'antiJARLocking'