jamieb wrote:
Hi there

I am busy implementing an auto update facility for a Tomcat web application.
As part of the auto update process, the auto update code needs to unpack the
changed class files and reload the Tomcat web application.
I am aware that you can configure Tomcat to automatically reload the web
application when class files are changed. I've decided against the use of
this functionality for fear of unscheduled service disruption.

My question: Is recommended way for a web application to apply an update to
itself and restart itself? Is there an API call to reload the current Tomcat
web application from within that application?

If app auto-reload facilities are switched off, you should be able to replace WAR files safely*, and then use the built in JMX stuff to restart the webapp in question.

(* If you're doing it from a remote location, be sure to send it to a safe directory /then/ do an internal copy to replace the file, rather than directly uploading to the target web app dir. Failed or slow uploads won't cause problems then.)



You can also use the included Tomcat Ant tasks, I think, (see bin/catalina-tasks.xml)

See also:

http://tomcat.apache.org/tomcat-6.0-doc/monitoring.html
http://tomcat.apache.org/tomcat-6.0-doc/mbeans-descriptor-howto.html

The Tomcat manager app uses JMX AFAIK, so you could examine the source code if you wanted to customise your own utility.


p




Much appreciate

Jamie




---------------------------------------------------------------------
To start a new topic, e-mail: users@tomcat.apache.org
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to