Tomcat Doesn't Stop. How to Debug This

Tomcat doesn't stop. How can I debug this?

If the web application is stopped, all connections to the database should be closed as well. If you don't have a list of connections, then execute the SQL statement "shutdown" (this only works for the H2 and HSQLDB databases).

If you have a registered a Servlet, you can do that in the Servlet.destroy() method.

If you have registered a ServletContextListener, you can execute the "shutdown" statement in the ServletContextListener.contextDestroyed(ServletContextEvent servletContextEvent) method. This is what org.h2.server.web.DbStarter ServletContextListener does (the one that is included in the H2 database).

Tomcat won't stop or restart

It seems Tomcat was actually stopped. I started it and it started fine. Thanks all.

Not able to stop the tomcat server in linux

I found the way to kill the server, first I found its process Id using : ps -eaf | grep tomcat
then killed the required process using its processId by : kill -9 *ID*

Should threads have special design to be shutdown gracefully by Tomcat?

... and to tie the other responses to the workings of Java Servlet environments;

if you don't declare your threads as daemon threads, the way to signal the server shutdown to the threads is to implement a ServletContextListener and configure it to your web application (web.xml). When Tomcat is shutting down, it will first shut down each application, which in turn will cause contextDestroyed() method of the listener to be called - and this is where you can signal your own threads that they should finish their work.



Related Topics



Leave a reply



Submit