Nov 02, 2017 3:11:39 PM org.apache.catalina.loader.WebappClassLoader clearReferencesJdbc
SEVERE: The web application [/XXXXXX] registered the JDBC driver [com.alibaba.druid.proxy.DruidDriver] but failed to unregister it when the web application was stopped. To prevent a memory leak, the JDBC Driver has been forcibly unregistered.
Nov 02, 2017 3:11:39 PM org.apache.catalina.loader.WebappClassLoader clearReferencesJdbc
SEVERE: The web application [/XXXXXX] registered the JDBC driver [com.mysql.jdbc.Driver] but failed to unregister it when the web application was stopped. To prevent a memory leak, the JDBC Driver has been forcibly unregistered.
Nov 02, 2017 3:11:39 PM org.apache.catalina.loader.WebappClassLoader clearReferencesThreads
SEVERE: The web application [/XXXXXX] appears to have started a thread named [Abandoned connection cleanup thread] but has failed to stop it. This is very likely to create a memory leak.
Nov 02, 2017 3:11:39 PM org.apache.catalina.loader.WebappClassLoader clearReferencesThreads
SEVERE: The web application [/XXXXXX] 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.
Nov 02, 2017 3:11:39 PM org.apache.catalina.loader.WebappClassLoader clearReferencesThreads
SEVERE: The web application [/XXXXXX] appears to have started a thread named [pool-1-thread-2] but has failed to stop it. This is very likely to create a memory leak.
Nov 02, 2017 3:11:39 PM org.apache.catalina.loader.WebappClassLoader clearReferencesThreads
SEVERE: The web application [/XXXXXX] appears to have started a thread named [pool-1-thread-3] but has failed to stop it. This is very likely to create a memory leak.
Nov 02, 2017 3:11:39 PM org.apache.catalina.loader.WebappClassLoader clearReferencesThreads
SEVERE: The web application [/XXXXXX] appears to have started a thread named [pool-1-thread-4] but has failed to stop it. This is very likely to create a memory leak.
Nov 02, 2017 3:11:39 PM org.apache.catalina.loader.WebappClassLoader clearReferencesThreads
SEVERE: The web application [/XXXXXX] appears to have started a thread named [Thread-7] but has failed to stop it. This is very likely to create a memory leak.
Nov 02, 2017 3:11:39 PM org.apache.catalina.loader.WebappClassLoader clearReferencesThreads
SEVERE: The web application [/XXXXXX] appears to have started a thread named [Thread-8] but has failed to stop it. This is very likely to create a memory leak.
Nov 02, 2017 3:11:39 PM org.apache.coyote.AbstractProtocol stop
INFO: Stopping ProtocolHandler ["http-bio-80"]
Nov 02, 2017 3:11:39 PM org.apache.coyote.AbstractProtocol stop
INFO: Stopping ProtocolHandler ["http-bio-8443"]
Nov 02, 2017 3:11:39 PM org.apache.coyote.AbstractProtocol stop
INFO: Stopping ProtocolHandler ["http-nio-443"]
Nov 02, 2017 3:11:39 PM org.apache.coyote.AbstractProtocol stop
INFO: Stopping ProtocolHandler ["ajp-bio-8009"]
Nov 02, 2017 3:11:39 PM org.apache.coyote.AbstractProtocol destroy
INFO: Destroying ProtocolHandler ["http-bio-80"]
Nov 02, 2017 3:11:39 PM org.apache.coyote.AbstractProtocol destroy
INFO: Destroying ProtocolHandler ["http-bio-8443"]
Nov 02, 2017 3:11:39 PM org.apache.coyote.AbstractProtocol destroy
INFO: Destroying ProtocolHandler ["http-nio-443"]
Nov 02, 2017 3:11:39 PM org.apache.coyote.AbstractProtocol destroy
INFO: Destroying ProtocolHandler ["ajp-bio-8009"]
现在已知产生这种情况的原因是有进程并未正常结束,阻止了 tomcat 的正常停止 请问各位在生产环境中一般是怎么配置的呢,如果有多台 tomcat 的话。
1
Sypher 2017-11-02 17:38:02 +08:00
以前遇到过,不是配置问题,是代码有问题啊,代码里面要关闭线程
|
2
funky 2017-11-02 17:46:43 +08:00
写个监听器实现 ServletContextListener 覆盖 contextDestroyed 方法
|
3
iyangyuan 2017-11-02 17:52:25 +08:00 via iPhone
检查代码才是正确选择,绝逼是有线程处于忙碌或阻塞状态,这基本上就能断定代码有 bug
|
4
aqqwiyth 2017-11-02 17:55:33 +08:00
System.exit(0)
|
5
kaneg 2017-11-02 18:02:56 +08:00
如果 shutdown 被某个线程给阻塞了, 比如加了 shutdown hook 之类的,那靠 tomcat 自己是没有可靠的办法退出了。这就需要外部强制其退出,比如用 kill -9 <pid>
|
6
qqwinds OP |
8
qqwinds OP @kaneg 我准备加 shutdown hook 了。。。之前一直用 kill -9 pid 的,后来发现,出现了好多问题,特别是在复杂业务的时候,业务执行完了,有时候没来得及返回结果就直接被 kill 了,客户端没收到信息,但是业务执行完了。。。比如这样
|