Redploying to Tomcat Server from Java Studio Creator

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 deployed.

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">
</Context>
And everything (undeploy / deploy / hot-deploy) worked fine after that!

Comments:

I have the same problem with the SUN Appserver 8.2x... Is there any workaround for the sunserver too ?

Posted by Stefan on September 05, 2006 at 09:45 PM PDT #

Great that Tomcat has a fix for jar locking. What about Sun Java System Appserver or Glassfish...

Posted by Corey Johnston on October 10, 2006 at 01:57 PM PDT #

Really helpful tip, thanks! Do you know how to include this in the build process so the file will get there automatically? Thanks, Andras

Posted by Andras Janurik on October 31, 2006 at 06:41 PM PST #

Thank you so much! I was being a muppet and including the context.xml in the META-INF of the jar file that Tomcat was holding the lock on, rather than in the application's war file, but I've finally realised that and this works like a dream - cheers!

Posted by Martin McNulty on December 21, 2006 at 11:58 PM PST #

Post a Comment:
  • HTML Syntax: NOT allowed
Search

Archives
« April 2014
SunMonTueWedThuFriSat
  
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
   
       
Today