What does 'Failed shutdown of Apache Portable Runtime' log message mean?
After shutting down tomcat, I get this message:
开发者_运维问答INFO: Failed shutdown of Apache Portable Runtime
Then Tomcat shuts down after all
I haven't found a reasonable explanation googling around, nor in the single duplicate I've found (0 answers)
The most common cause is that a non-daemon thread is still running (Tomcat FAQ). Click here for more information on daemon threads.
To find out which thread is causing problems (on Unix):
- do a
kill -3 tomcatProcId
(find tomcatProcId using ps) - look inside $TOMCAT_HOME/logs/catalina.out for the thread dump generated by the kill
- look at all the non-daemon threads (those not marked with "daemon") that are not VM/GC related
- for each one, find out what code spawned it, and why it has not terminated correctly. Some non-daemon threads check frequently to terminate, which is OK.
If you want, you can instruct Tomcat to kill the JVM after shutdown, even if non-daemon threads remain (which might sometimes be a bad thing):
- define the CATALINA_PID environment variable. For example:
export CATALINA_PID=/tmp/catalina_pid
- use
catalina.sh stop -force
to stop Tomcat.
It seems that this is not due to some daemon threads after all, just a poor log message
https://issues.apache.org/bugzilla/show_bug.cgi?id=38652
精彩评论