Return-Path: Delivered-To: apmail-jakarta-tomcat-user-archive@www.apache.org Received: (qmail 35919 invoked from network); 3 Oct 2005 12:05:29 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (209.237.227.199) by minotaur.apache.org with SMTP; 3 Oct 2005 12:05:29 -0000 Received: (qmail 6112 invoked by uid 500); 3 Oct 2005 12:05:15 -0000 Delivered-To: apmail-jakarta-tomcat-user-archive@jakarta.apache.org Received: (qmail 6095 invoked by uid 500); 3 Oct 2005 12:05:15 -0000 Mailing-List: contact tomcat-user-help@jakarta.apache.org; run by ezmlm Precedence: bulk List-Unsubscribe: List-Help: List-Post: List-Id: "Tomcat Users List" Reply-To: "Tomcat Users List" Delivered-To: mailing list tomcat-user@jakarta.apache.org Received: (qmail 6084 invoked by uid 99); 3 Oct 2005 12:05:14 -0000 Received: from asf.osuosl.org (HELO asf.osuosl.org) (140.211.166.49) by apache.org (qpsmtpd/0.29) with ESMTP; Mon, 03 Oct 2005 05:05:14 -0700 X-ASF-Spam-Status: No, hits=-0.0 required=10.0 tests=SPF_HELO_PASS,SPF_PASS X-Spam-Check-By: apache.org Received-SPF: pass (asf.osuosl.org: domain of David.Delbecq@oma.be designates 193.190.231.71 as permitted sender) Received: from [193.190.231.71] (HELO bonnie.oma.be) (193.190.231.71) by apache.org (qpsmtpd/0.29) with ESMTP; Mon, 03 Oct 2005 05:05:19 -0700 Received: from [193.190.249.120] (bonnie.oma.be [193.190.231.71]) by bonnie.oma.be (8.11.1 (Revision 1.5) /8.11.1) with ESMTP id j93C4qD28148 for ; Mon, 3 Oct 2005 12:04:52 GMT Message-ID: <43411E90.2000801@oma.be> Date: Mon, 03 Oct 2005 14:05:36 +0200 From: David Delbecq User-Agent: Mozilla Thunderbird 1.0.6 (X11/20050802) X-Accept-Language: fr, en MIME-Version: 1.0 To: Tomcat Users List Subject: Re: FAQ? shutdown.bat not killing java process on Windows References: <914a054e0510020908r2318ebcasbd004f95da44ec7d@mail.gmail.com> <43410A5A.7090204@mkodo.com> In-Reply-To: Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 8bit X-Virus-Checked: Checked by ClamAV on apache.org X-Spam-Rating: minotaur.apache.org 1.6.2 0/1000/N That's quite a problem ;) Actually your threads should be coded in such a way you may a send a notification in java telling him to finish his job. eg: myNonDaemonThreadICreatedMySelf.stopWorking(); which would set some flag in Thread and then code in your Thread reading the flag knows it has to stop in a clean way. In the past there was a way in java to 'kill' a Thread but this has been deprecated in the Thread api. Tomcat sends a ThreadDeathError to the thread if it tries to interact with its classloader after shutdown, unfortunately, this is not always enough has some Threads do a catch(Error) and then continue their job. The best thing you can do when you have the list of threads still alive after shutdown is to locate the irresponsible threads and fix their code :D Larry Meadors a �crit : >So, once you know the threads that are left, what is the cleanest way >to kill them? > >I have had this problem too, but since it was on a *nix platform, and >just used 'kill' to get rid of the parent process. > >Larry > > >On 10/3/05, Jon Wingfield wrote: > > >>Yep. It's a FAQ, but not in the FAQ. >> >>Tomcat not quitting generally means your webapp has started a non-daemon >>thread which does not exit when the webapp is destroyed. If so, shut >>them down in a ServletContextListener. >> >>If you aren't explicitly creating threads in your webapp then the usual >>culprits are database connections that haven't been closed (or any other >>client api to remote services that uses asynchronous messaging and/or >>keepalive semantics). >> >>To see a dump of the threads still active after you've run shutdown.bat >>do a CTRL-BREAK in the tomcat dos console. >> >>HTH, >> >>Jon >> >>Charles Fineman wrote: >> >> >>>I started Tomcat using startup.bat. Everything goes fine. I use >>>shutdown.batto bring it down. The server fields the request and shuts >>>down a bunch of >>>services (as evidenced by the messages I see). Sure enough, the server no >>>longer responds to any requests. Unfortunately, the java process does not >>>die. >>> >>>I have this problem whether I start Tomcat by hand or if I use the Sysdeo >>>Eclipse plugin. >>> >>>This problem has been a thorn in my side for some time but since it only >>>affects my development environment (we use it as a service in production and >>>there are no problems) and I can kill the process by hand, I've not worried >>>about it. It's annoying as heck though and I'm wondering if someone can shed >>>some light. >>> >>>I searched around but (surprisingly!!) I didn't find anything similar to my >>>situation. >>> >>> >>> >> >>--------------------------------------------------------------------- >>To unsubscribe, e-mail: tomcat-user-unsubscribe@jakarta.apache.org >>For additional commands, e-mail: tomcat-user-help@jakarta.apache.org >> >> >> >> > >--------------------------------------------------------------------- >To unsubscribe, e-mail: tomcat-user-unsubscribe@jakarta.apache.org >For additional commands, e-mail: tomcat-user-help@jakarta.apache.org > > > --------------------------------------------------------------------- To unsubscribe, e-mail: tomcat-user-unsubscribe@jakarta.apache.org For additional commands, e-mail: tomcat-user-help@jakarta.apache.org