Redploying to Tomcat Server from Java Studio Creator
By winston on Sep 05, 2006
The Web Application Created using Sun Java Studio Creator can be deployed to other Web Servers such as Tomcat Web Server. See the Online Help for more details.
However, some customers noticed that every time they deploy the Web Application that has been exported as War file, they have to restart the Tomcat Server when the war file is being redeployed again. The reason is the War wouldn't get redeployed because some jars get locked. I think most probably this problem may occur on Windows.
Thanks to Haroon A. of Motorola, now we have a solution to fix this problem. The following is from his posting.
The problem is Tomcat locks up some jar files in the web-inf/lib
directory, and so the undeploy can't happen. Therefore Tomcat has to be
shutdown, and directory deleted before another version of the WAR file can be
Here is how I solved this problem:
I found that I have to add a file META-INF/context.xml with the following contents:
<Context antiJARLocking="true" antiResourceLocking="true">
And everything (undeploy / deploy / hot-deploy) worked fine after that!