You can't, and generally don't want to stop Tomcat (the server) when an application is mis-configured. Instead, you can stop (mark unavailable) your application. One way to do this is to throw an exception inside a ServletContextListener, if it detects wrong values inside the configuration file:
SEVERE: Exception sending context initialized event to listener instance of class tim.lucia.ApplicationLifecycleListener java.lang.RuntimeException: Bad Configuration at tim.lucia.ApplicationLifecycleListener.contextInitialized(ApplicationLifecyc leListener.java:24) Tim > -----Original Message----- > From: padam chhetri [mailto:[EMAIL PROTECTED] > Sent: Tuesday, April 24, 2007 2:27 AM > To: users@tomcat.apache.org > Subject: Tomcat does not stop if the deployment fails > > Hi All, > > I need to stop the tomcat gracefully(not manually) if the deployment of my > web application fails. > The scenario is this my web application has configuration file if I > enter the > wrong values in the file then the deployment of my appplication fails but > the Tomcat starts up successfully .But at this point I want Tomcat also to > stop > instead of starting up successfully > Thanks in advance > > > Pam > > > --------------------------------- > Ahhh...imagining that irresistible "new car" smell? > Check outnew cars at Yahoo! Autos. --------------------------------------------------------------------- To start a new topic, e-mail: users@tomcat.apache.org To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]