异常如下:
严重: The web application [/codeMarket] registered the JBDC 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.
2012-2-9 17:43:12 org.apache.catalina.loader.WebappClassLoader clearReferencesJdbc
严重: The web application [/codeMarket] registered the JBDC driver [oracle.jdbc.OracleDriver] but failed to unregister it when the web application was stopped. To prevent a memory leak, the JDBC Driver has been forcibly unregistered.
2012-2-9 17:43:12 org.apache.catalina.loader.WebappClassLoader clearReferencesThreads
严重: The web application [/codeMarket] appears to have started a thread named [Timer-0] but has failed to stop it. This is very likely to create a memory leak.
2012-2-9 17:43:12 org.apache.catalina.loader.WebappClassLoader clearThreadLocalMap
严重: The web application [/codeMarket] created a ThreadLocal with key of type [null] (value [com.opensymphony.xwork2.inject.ContainerImpl$10@e1666]) and a value of type [java.lang.Object[]] (value [[Ljava.lang.Object;@e0ada6]) but failed to remove it when the web application was stopped. This is very likely to create a memory leak.
2012-2-9 17:43:12 org.apache.catalina.loader.WebappClassLoader clearThreadLocalMap
严重: The web application [/codeMarket] created a ThreadLocal with key of type [null] (value [com.opensymphony.xwork2.inject.ContainerImpl$10@a8a314]) and a value of type [java.lang.Object[]] (value [[Ljava.lang.Object;@16ab2e8]) but failed to remove it when the web application was stopped. This is very likely to create a memory leak.
AbandonedObjectPool is used (org.apache.commons.dbcp.AbandonedObjectPool@11f1f12)
搜了一堆资料终于搞懂了
第一个问题:
严重: The web application [/codeMarket] registered the JBDC driver [oracle.jdbc.OracleDriver] but failed to unregister it when the web application was stopped. To prevent a memory leak, the JDBC Driver has been forcibly unregistered.
------------------------------------------------------------------------------------------------------------------------------------------------------
网上资料:
详细如下:
应用程序注册了JDBC驱动,但当程序停止时无法注销这个驱动,tomcat为了防止内存溢出,就给强制注销了
https://issues.apache.org/jira/browse/DBCP-332
-------------------------------------------------------------------------------------------------------------------
解决:
重写了org.apache.commons.dbcp.BasicDataSource
package org.company.util;
import java.sql.DriverManager;
import java.sql.SQLException;
import org.apache.commons.dbcp.BasicDataSource;
public class XBasicDataSource extends BasicDataSource{
//
}
。。。
在dbcp数据源中的配置:
问题解决~
-------------------------------------------------------------------------------------------------------------
再重新加载的时候发现还有:
严重: The web application [/codeMarket] registered the JBDC 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.
2012-2-9 17:43:12 org.apache.catalina.loader.WebappClassLoader clearReferencesJdbc
检查了一下jar包