File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
Win a copy of Clojure in Action this week in the Clojure forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Restarting issue when we edit context.xml

 
Elan Ram
Ranch Hand
Posts: 40
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi Folks,

One of the tomcat server in our project is restarting automatically when ever we edit the context.xml file. We have installed tomcat from redhat inbuilt package. Is this known issue or any body have come across similar issue in past?

 
Kees Jan Koster
JavaMonitor Support
Rancher
Posts: 251
5
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
This is expected behaviour from Tomcat. What makes you say this is an 'issue'?
 
Elan Ram
Ranch Hand
Posts: 40
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi Kees,

Thanks for your reply. My understanding is we need to restart the server manually if there are changes in server.xml or context.xml(Please correct me if i am wrong). I am not able to understand why is it happening automatically?
 
Tim Holloway
Saloon Keeper
Pie
Posts: 17633
39
Android Eclipse IDE Linux
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
It doesn't "restart the server". Not unless you're running it under an IDE which is usurping Tomcat's normal functions.

It's restarting the webapp. Other webapps in the Tomcat server (and the Tomcat server itself) should remain unaffected.

This is basically Tomcat's "hot deploy" feature at work. Changing classfiles in the webapp or changing the deployment descriptor will cause the scanner in Tomcat to detect the change and redeploy (thus restarting) the webapp. At least unless you switch off the hot deploy feature.
 
Elan Ram
Ranch Hand
Posts: 40
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi Tim,

Yes. I can accept your point. We are not allowing the hot deployment and not making any changes in the web application level. We are changing the configuration file at Tomcat server level. We observing the behavior of restarting the Tomcat server.
 
Ben Souther
Sheriff
Posts: 13411
Firefox Browser Redhat VI Editor
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Search this page for the "reloadable" configuration.

Not sure where it's set on your system.

 
Tim Holloway
Saloon Keeper
Pie
Posts: 17633
39
Android Eclipse IDE Linux
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I forgot to mention. The context XML file (Context element) is the Deployment Descriptor. Although originally it was embedded in the Tomcat configuration file (server.xml), that mode of operation has been discouraged since Tomcat 4.

And someday I hope that the people who do the Eclipse WST plugin will get the hint and do likewise.

Changing server.xml wouldn't trigger an automatic restart, although it also wouldn't dynamically detect deployment descriptor changes for the same reason (which is WHY that mode is discouraged).

However, changing the deployment descriptor itself would restart the app. That's regardless of whether you defined an external DD (conf/Catalina/localhost/xxxxx.xml) or internal (META-INF/context.xml). And actually, I'm not sure but what changing the deployment descriptor wouldn't be considered as grounds for restart even if hot-deploy is turned off, now that I think about it. Especially since it's well-known that Tomcat thinks it owns the external DDs and will actually delete them right out from under you if it decides it doesn't like them.
 
Elan Ram
Ranch Hand
Posts: 40
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi,

Thanks all for your valuable knowledge sharing.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic