File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
The moose likes Tomcat and the fly likes Changing server.xml without restarting Tomcat Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login

Win a copy of Java Interview Guide this week in the Jobs Discussion forum!
JavaRanch » Java Forums » Products » Tomcat
Bookmark "Changing server.xml without restarting Tomcat" Watch "Changing server.xml without restarting Tomcat" New topic

Changing server.xml without restarting Tomcat

som chatterjee

Joined: Oct 08, 2008
Posts: 2
Hi all,

I am using Tomcat clustering (with static membership) in one of my assignments. When a new instance gets added to the cluster, one static member tag should get added to server.xml of each instance of the cluster. But changing the server.xml means restarting the server - so if I have 10 instances in the cluster and I try to add a new one, we'll have to restart 10 servers because of change in their server.xml - which is not desired.

Is there any way out to reflect the change of server.xml without restarting the server? I am using Tomcat version 6.0.36.

(Dynamic membership cannot be added because of some restrictions)

Thanks in advanced,
Tim Holloway
Saloon Keeper

Joined: Jun 25, 2001
Posts: 17423

Welcome to the JavaRanch, Som!

The server.xml file is digested at Tomcat startup. To get Tomcat to see any changes, Tomcat must be restarted. This is why Context elements in server.xml are discouraged - updating a webapp (Context) when it's in server.xml cannot be done on the fly.

If you cannot support dynamic clustering, you're going to have to cycle each Tomcat. Although at least, since it's a cluster, that means that you only have the annoyance of cycling Tomcats and not of having the entire service down.

An IDE is no substitute for an Intelligent Developer.
I agree. Here's the link:
subject: Changing server.xml without restarting Tomcat
It's not a secret anymore!