but has failed to stop it. This is very likely to create a memory leak(c3p0在Spring管理中,连接未关闭导致的内存溢出)

以下是错误日志信息:

严重: The web application [/news] 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-12-19 0:27:47 org.apache.catalina.loader.WebappClassLoader clearReferencesThreads
严重: The web application [/news] appears to have started a thread named [C3P0PooledConnectionPoolManager[identityToken->1pyjusp96q571f188m8|18782a7]-AdminTaskTimer] but has failed to stop it. This is very likely to create a memory leak.
2014-12-19 0:27:47 org.apache.catalina.loader.WebappClassLoader clearReferencesThreads
严重: The web application [/news] appears to have started a thread named [C3P0PooledConnectionPoolManager[identityToken->1pyjusp96q571f188m8|18782a7]-HelperThread-#0] but has failed to stop it. This is very likely to create a memory leak.
2014-12-19 0:27:47 org.apache.catalina.loader.WebappClassLoader clearReferencesThreads
严重: The web application [/news] appears to have started a thread named [C3P0PooledConnectionPoolManager[identityToken->1pyjusp96q571f188m8|18782a7]-HelperThread-#1] but has failed to stop it. This is very likely to create a memory leak.
2014-12-19 0:27:47 org.apache.catalina.loader.WebappClassLoader clearReferencesThreads
严重: The web application [/news] appears to have started a thread named [C3P0PooledConnectionPoolManager[identityToken->1pyjusp96q571f188m8|18782a7]-HelperThread-#2] but has failed to stop it. This is very likely to create a memory leak.


堆栈信息:

Exception in thread "C3P0PooledConnectionPoolManager[identityToken->1pyjusp96q571f188m8|18782a7]-AdminTaskTimer" java.lang.NullPointerException
    at com.mchange.v2.log.log4j.Log4jMLog$Log4jMLogger.isLoggable(Log4jMLog.java:293)
    at com.mchange.v2.async.ThreadPoolAsynchronousRunner$DeadlockDetector.run(ThreadPoolAsynchronousRunner.java:729)
    at java.util.TimerThread.mainLoop(Timer.java:512)
    at java.util.TimerThread.run(Timer.java:462)



我的情况是在配置数据源时未配置销毁dataSource对象时执行close方法关闭连接

	<bean id="dataSource" class="com.mchange.v2.c3p0.ComboPooledDataSource" >
		<property name="driverClass" value="${driverClass}"></property>
		<property name="jdbcUrl" value="${jdbcUrl}"></property>
		<property name="user" value="${user}"></property>
		<property name="password" value="${password}"></property>

		<property name="initialPoolSize" value="1"></property>
		<property name="minPoolSize" value="1"></property>
		<property name="maxPoolSize" value="20"></property>
		<property name="maxIdleTime" value="60"></property>
	</bean>

<bean id="dataSource" class="com.mchange.v2.c3p0.ComboPooledDataSource" > 在这里面加入destroy-method="close"

  • 1
    点赞
  • 3
    收藏
    觉得还不错? 一键收藏
  • 4
    评论
评论 4
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值