File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
The moose likes Tomcat and the fly likes Deploying application updates in tomcat. - a pain. Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Products » Tomcat
Bookmark "Deploying application updates in tomcat. - a pain." Watch "Deploying application updates in tomcat. - a pain." New topic

Deploying application updates in tomcat. - a pain.

Poorav Chaudhari
Ranch Hand

Joined: Sep 17, 2002
Posts: 50
Hello all,
I would like to hear your thoughts on how the experienced developers have handled this scenario. At the moment I follow the steps below everytime I want to update my application on the production server. Assume that I have already deployed one version of the application. I have a context entry for the application in the server.xml file. I am going to call my application MyApp for the moement.
1. Create a MyApp.war file.
2. Shut tomcat
3. Remove MyApp.war and the MyApp folder from the webapps/ folder.
4. i remove the context entry for the application in server.xml (i basically just change the name)
5. copy the new MyApp.war file into webapps/ folder,
6. start tomcat. This will create the MyApps folder.
7. change the server.xml entry back.
8. Restart tomcat.
Shouldn't the process of deploying be simpler. I know if I didn't have an entry for the application in the server.xml file, then I would simply have to replace the files and restart tomcat. But i need the server.xml entry because the context has the JNDI datasource declaration and the logger declaration.
by the way I am using tomcat 4.1.24, and jdk 1.4.1
I would really like to hear your input on this. Thank you.

Poorav Chaudhari
Nathaniel Stoddard
Ranch Hand

Joined: May 29, 2003
Posts: 1258
I'm not a big-time expert on Tomcat -- but as I recall reading in Tomcat: the Definitive Guide by the good folks at O'Reilly ... you can create a simple XML file which gets put in the deploy directory. The XML file should contain a subset of tags that are normally placed in the server.xml file, which will apply only to your deployed web application.
You'll have to go search the tomcat website for the specifics, but I think this is the best chance of success for you. Hopefully somebody more knowledgeable will be able to fill in the gaps here or give you a more correct answer.
The links on the Tomcat website of interest (hopefully):
1. Context xml file
2. Automatic Deployment
As the Context tag contains the logger, and other resources, this may be what you are looking for.
[ March 17, 2004: Message edited by: Nathaniel Stoddard ]

I agree. Here's the link:
subject: Deploying application updates in tomcat. - a pain.
jQuery in Action, 3rd edition