当前位置: 代码迷 >> Java Web开发 >> 在myeclipse里用Tomcat7发布一个SSH的程序,程序需要连接数据库,有一点小异常
  详细解决方案

在myeclipse里用Tomcat7发布一个SSH的程序,程序需要连接数据库,有一点小异常

热度:227   发布时间:2016-04-16 22:27:09.0
在myeclipse里用Tomcat7发布一个SSH的程序,程序需要连接数据库,有一点小错误
严重: The web application [/Test] 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.
2014-4-25 22:36:52 org.apache.catalina.loader.WebappClassLoader clearReferencesThreads
严重: The web application [/Test] 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.
2014-4-25 22:36:52 org.apache.catalina.loader.WebappClassLoader checkThreadLocalMapForLeaks
严重: The web application [/Test] created a ThreadLocal with key of type [com.opensymphony.xwork2.inject.ContainerImpl$10] (value [com.opensymphony.xwork2.inject.ContainerImpl$10@3096fa7b]) and a value of type [java.lang.Object[]] (value [[Ljava.lang.Object;@816ba29]) but failed to remove it when the web application was stopped. Threads are going to be renewed over time to try and avoid a probable memory leak.
2014-4-25 22:36:55 org.apache.catalina.startup.TaglibUriRule body
------解决方案--------------------
The web application [/Test] 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.
------解决方案--------------------
分享 
------解决方案--------------------
应该算是警告吧,是 Tomcat 里的 ThreadLocalLeakPreventionListener 和 JreMemoryLeakPreventionListener 检查发出的,原因日志里说很清楚了。解决办法我是写个 ServletContextListener,在 contextDestroyed 方法里把能处理的处理掉:数据库驱动可以解除注册;ThreadLocal 估计没办法,怪 struts 去吧。
------解决方案--------------------
在listener里面注销数据库驱动
  相关解决方案