Prevent Locking of Exploded Wars

The problem

It is at development time often very convenient to work with exploded wars. Tweaks to JSP files can be made on the fly, without the need to redeploy. Tomcat picks up the changes straight away. The downside is that some jars (ehcache for one) retain some kind of lock when the war is undeployed.

The solution

Fortunately the tomcat developers took care of this. Add the following to $CATALINA_HOME/conf/context.xml (this is the file all deployed webapps 'inherit' from) and those locks will not appear anymore.

<Context antiJARLocking="true">
Enter labels to add to this page:
Please wait 
Looking for a label? Just start typing.