aspose file tools*
The moose likes Tomcat and the fly likes Struts2 + Tomcat Hot Deployment of war Not Working Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Products » Tomcat
Bookmark "Struts2 + Tomcat Hot Deployment of war Not Working" Watch "Struts2 + Tomcat Hot Deployment of war Not Working" New topic
Author

Struts2 + Tomcat Hot Deployment of war Not Working

Amit Parmar
Greenhorn

Joined: Jun 07, 2010
Posts: 2
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.
Tim Holloway
Saloon Keeper

Joined: Jun 25, 2001
Posts: 16014
    
  20

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.

Customer surveys are for companies who didn't pay proper attention to begin with.
Davie Lin
Ranch Hand

Joined: Aug 05, 2007
Posts: 294
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

Joined: Jun 07, 2010
Posts: 2
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.
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Struts2 + Tomcat Hot Deployment of war Not Working