wood burning stoves 2.0*
The moose likes Tomcat and the fly likes Tomcat times out on shutdown Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of OCA/OCP Java SE 7 Programmer I & II Study Guide this week in the OCPJP forum!
JavaRanch » Java Forums » Products » Tomcat
Bookmark "Tomcat times out on shutdown" Watch "Tomcat times out on shutdown" New topic
Author

Tomcat times out on shutdown

Ron Newman
Ranch Hand

Joined: Jun 06, 2002
Posts: 1056
When I shut Tomcat down, via the bin/shutdown.sh script, Tomcat takes a long time to actually stop. I find this in my catalina.out log file. What does it mean, and how can I fix it?


Ron Newman - SCJP 1.2 (100%, 7 August 2002)
Carl Trusiak
Sheriff

Joined: Jun 13, 2000
Posts: 3340
Tomcat uses a Socket Connection to the Running server to control it. It's waiting for the server to send a notice that it quit. The server is waiting for all Threads started to terminate. Perhaps you have started a Thread in one of your applications and don't have a shutdown hook to end it! A connection pool or cache manager is one type of Thread.
Do any of your apps start a Thread?


I Hope This Helps
Carl Trusiak, SCJP2, SCWCD
Ron Newman
Ranch Hand

Joined: Jun 06, 2002
Posts: 1056
I do have a connection pool, registered with JNDI. I don't see any way to get hold of it and shut it down when the Servlet context is destroyed (in fact, this is something I've asked about in other posts here, without getting a good answer.)
[ August 14, 2003: Message edited by: Ron Newman ]
Carl Trusiak
Sheriff

Joined: Jun 13, 2000
Posts: 3340
Is it the Container specific JNDI DataSource? Tomcat knows how to control that and that should not cause a problem. If it is some other implementation, you need to find out how it's controlled.
Ron Newman
Ranch Hand

Joined: Jun 06, 2002
Posts: 1056
Yes, it's the Tomcat JNDI DataSource connection pool. So far, I don't have any evidence that Tomcat ever shuts it down.
Ron Newman
Ranch Hand

Joined: Jun 06, 2002
Posts: 1056
Also, the timeout exception occurs in catalina.out , NOT in the shell window where I run the "shutdown.sh" script.
Carl Trusiak
Sheriff

Joined: Jun 13, 2000
Posts: 3340
Which version of Tomcat? Whcih JDK?
Ron Newman
Ranch Hand

Joined: Jun 06, 2002
Posts: 1056
Tomcat 4.1.24 on Java 1.4.1 on MacOS X 10.2.6.
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Tomcat times out on shutdown