free web page hit counter
Tuesday Sep 05, 2006

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 06, 2006 at 04:45 AM 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 08: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 November 01, 2006 at 02:41 AM 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 22, 2006 at 07:58 AM PST #

http://www.batteryfast.co.uk/mitac/bp-8089p.htm mitac bp-8089p battery,
http://www.batteryfast.co.uk/mitac/e680.htm mitac e680 battery,
http://www.batteryfast.co.uk/mitac/minote-8080.htm mitac minote 8080 battery,

Posted by laptop batteries on October 24, 2008 at 12:05 AM PDT #

If you need (or want) a computer that’s easy to take along,you can see it from http://www.adapterlist.com/mitac/minote-8080.htm mitac minote 8080 battery whcih offer the longlife and consistently reliable performance you need to get the most out of your notebook .

Posted by laptop bettery on March 05, 2009 at 09:45 PM PST #

Do you want to own some betteries which have more function , more economical and long life? Please visit the following Web site: http://www.adapterlist.com/mitac/e680.htm mitac e680 battery,it will help you find the ideal battery.

Posted by laptop bettery on March 06, 2009 at 05:55 PM PST #

Post a Comment:
  • HTML Syntax: NOT allowed