Tomcat + System.exit(0) will shutdown tomcat
Posted on 2003-03-01
I have tomcat as my application server.
And there are nearly 10 context running under my tomcat.All are my application which are very critical, and they can't go offline by any means. They should be online 24x7 running.
I have tested that in any of application i.e.,JSP or Servelt or Bean...
If that contains System.exit(0); or System.exit(-1);
It will shut down tomcat.
I know that System.exit(0); is used for normal op abnoraml shutdown of JVM.
So there could be a senario of any person putting a small JSP with System.exit() and running that, it will shutdown my tomcat, that means all my application will go offline and i have to start my tomcat again.
And there could be another senario also the user putting the servlet or JSP in a startup servlet of tomcat, so whenever a tomcat is started, after that my context will comeup and startup servlet will be invoked and it contains System.exit(); and this will shutdown tomcat.
Is there anyway to stop that...means not accepting System.exit(0) instruction from any context running under tomcat?
could anyone help out with this.