• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

Struts2 + Tomcat Hot Deployment of war Not Working

 
Greenhorn
Posts: 2
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hello!

I have a problem with Tomcat hot deployment. Any help will be heartity appreciated.

I am working on various web applications one of them being a Struts2 application. When I deploy the war file from Elcipse, the war is not exploded property.
So I have to Stop Tomcat -> Delete the context of the application -> Restart Tomcat, everytime I want to deploy the changes.

This is a problem only with the Struts2 application. Other applications are working all right.

Googling I came to know of setting attributes [reloadable="true" antijarlocking="true" antiresourcelocking="true"] in Context.xml but that too does not solve the problem.

Here is my environment detail:
Tomcat : 5.5.25
Eclipse for Java developer : 3.2.2
JDK : 1.5

Any help will be appreciated.

Regards,
Amit Parmar.
 
Saloon Keeper
Posts: 27762
196
Android Eclipse IDE Tomcat Server Redhat Java Linux
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Actually, I'm not really sure if exploding WARs has that much benefit unless you intend to go in and modify the live copy of the WAR in the server, but in current releases of Tomcat, explosion is turned on by default.

Despite how it looks, there's nothing Struts-specific about this. If you copy a new WAR file into TOMCAT_HOME/webapps, Tomcat will ignore it as long as there's an exploded WAR in the same directory, even though the WARfile is newer.

If you delete the WAR directory and there's a WARfile, it "should" explode the WARfile when the next request comes in. If there is no WARfile and you have a Context file in conf/Catalina/localhost, Tomcat will delete the Context file , which will undeploy the application.

There is a general problem with hot deployment in that a lot of times if you deploy a new set of servlets, the init() method of the new servlet won't be (re)invoked. This can be a problem for systems like Struts or JavaServerFaces, where config information is being read in and distilled. I've also had issues with ORM systems and hot-deployment for similar reasons.
 
Ranch Hand
Posts: 294
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

Amit Parmar wrote:Hello!

Here is my environment detail:
Tomcat : 5.5.25
Eclipse for Java developer : 3.2.2
JDK : 1.5

Any help will be appreciated.

Regards,
Amit Parmar.



I think Tomcat 6 works a lot better with hot deploy
 
Amit Parmar
Greenhorn
Posts: 2
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hello Tim & Davie

Thank you so much for your replies. I could fix the problem by adding the following to TOMCAT_HOME/conf/context.xml

<Context reloadable="true" antiJARLocking="true" antiResourceLocking="true">

Thank you once again.
Regards,
Amit Parmar.
 
This looks like a job for .... legal tender! It says so right in this tiny ad:
a bit of art, as a gift, the permaculture playing cards
https://gardener-gift.com
reply
    Bookmark Topic Watch Topic
  • New Topic