Originally posted by Meir Yan:
There must be some kind of hack..
There are always hacks.
If you're running on a unix system, Tomcat is started and stopped with shell scripts in the bin directory.
This is also the case with the batch scripts if you're on a Windows and have installed Tomcat with the ".zip" distribution.
You could write a servlet that uses Runtime.exec to call those scripts.
If you're running Tomcat as a Windows service, you can use the net stop <service-name> to stop it.
A real crude way of stopping it (REAL crude) would be to call System.exec(1) from within your
Java code. This shuts down the entire JVM in which Tomcat is running.
If Tomcat is running under a security manager, none of the above will probably be allowed without modifying the policy.
I still think there should be a better way to let the parent app know that there is a problem with the web app. It can't detect a 500 error code coming from Tomcat?
[ August 15, 2007: Message edited by: Ben Souther ]