On 17.04.20 16:55, Blake McBride wrote:
> I suppose, never mind.  I created a startup listener that just does a
> System.exit(0) on contextDestroyed which is what I want - exit.
>
> Thanks.
>
> Blake
>
>
> On Fri, Apr 17, 2020 at 8:53 AM Blake McBride <blake1...@gmail.com> wrote:
>
>> Greetings,
>>
>> I am running vanilla tomcat 9.0.34 on a 64 bit Linux box.  Short of
>> killall, I can't stop tomcat.  I am trying bin/shutdown.sh.  Sure
>> appreciate some help.

The proper solution is in your log:

"The web application [Kiss] appears to have started a thread named
[Thread-5] but has failed to stop it."

If that's not a daemon thread, the JVM, by design, can't stop.

Instead of calling System.exit(), do the right thing and implement
proper shutdown for all threads that the application starts on its own.
Or, if you don't care about interrupting them at inopportune time (as
you demonstrate with System.exit), simply set their daemon flag and
leave their buggy implementation in place.

By the way: This behavior will keep the application from proper
redeployment. My recommendation: Correct your implementation rather than
nuking it from orbit.

Olaf

>> 17-Apr-2020 08:44:41.745 WARNING [main]
>>  org.apache.catalina.loader.WebappClassLoaderBase.clearReferencesThreads The
>> web application [Kiss] appears to have started a thread named [Thread-5]
>> but has failed to stop it. This is very likely to create a memory leak.
>> Stack trace of thread:
>>  sun.misc.Unsafe.park(Native Method)
>>  java.util.concurrent.locks.LockSupport.park(LockSupport.java:175)
>>
>>  
>> java.util.concurrent.locks.AbstractQueuedSynchronizer$ConditionObject.await(AbstractQueuedSynchronizer.java:2044)
>>
>>  
>> java.util.concurrent.LinkedBlockingDeque.takeFirst(LinkedBlockingDeque.java:492)
>>  org.kissweb.rest.QueueManager$Dispatcher.run(QueueManager.java:61)
>>  java.lang.Thread.run(Thread.java:748)
>> 17-Apr-2020 08:44:41.745 WARNING [main]
>> org.apache.catalina.loader.WebappClassLoaderBase.clearReferencesThreads The
>> web application [Kiss] appears to have started a thread named
>> [pool-1-thread-1] but has failed to stop it. This is very likely to create
>> a memory leak. Stack trace of thread:
>>  sun.misc.Unsafe.park(Native Method)
>>  java.util.concurrent.locks.LockSupport.park(LockSupport.java:175)
>>
>>  
>> java.util.concurrent.locks.AbstractQueuedSynchronizer$ConditionObject.await(AbstractQueuedSynchronizer.java:2044)
>>
>>  java.util.concurrent.LinkedBlockingQueue.take(LinkedBlockingQueue.java:442)
>>
>>  
>> java.util.concurrent.ThreadPoolExecutor.getTask(ThreadPoolExecutor.java:1074)
>>
>>  
>> java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1134)
>>
>>  
>> java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624)
>>  java.lang.Thread.run(Thread.java:748)
>> 17-Apr-2020 08:44:41.749 INFO [main]
>> org.apache.coyote.AbstractProtocol.stop Stopping ProtocolHandler
>> ["http-nio-8080"]
>> 17-Apr-2020 08:44:41.750 INFO [main]
>> org.apache.coyote.AbstractProtocol.destroy Destroying ProtocolHandler
>> ["http-nio-8080"]
>> blake@i9-tower:~/intellijProjects/Kiss/tomcat/logs$
>>

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org
For additional commands, e-mail: users-h...@tomcat.apache.org

Reply via email to