jamieb wrote:
Hi
Thanks for the tip. While I am very grateful for your advice, I am not sure
I like either of the approaches. I was hoping just to call a Tomcat API
function directly from my web application.
Tomcat provides an API, in the form of JMX.
Is'nt there a method called restart() or something?
I'm not aware of one, have you found one in the docs?
JMX seems like overkill since I do not need to
control the application remotely. The application doing the calling is the
application that needs to be restarted itself. Any further ideas?
You haven't elaborated on how you're connecting to the box, but a simple
JMX app could be run from the command line, or another webapp on the
same server.
I'd suggest that you would be better off if a different app called the
restart, as you'll never be able to recover (or notify afterwards) from
a failure if the app itself is down.
p
Thanks
Jamie
Pid-2 wrote:
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]
---------------------------------------------------------------------
To start a new topic, e-mail: users@tomcat.apache.org
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]