首页 > 文章 > WEB > tomcat > 正文

Tomcat报错:DBCP object created by the following code was never
2010-12-11 20:33:40   来源:   评论:0 点击:

Tomcat报错:DBCP object created by the following code was never

Tomcat报错:DBCP object created by the following code was never closed:

原创作品  文章作者:linuxzgf    转载请注明原文链接:http://www.f5ha.com/2010/1211/417.html
欢迎大家转载运维家园文章到自己的网站/博客/微博,请勿修改原文内容,谢谢!

DBCP object created 2010-12-11 11:08:00 by the following code was never closed:
java.lang.Exception
 at org.apache.tomcat.dbcp.dbcp.AbandonedTrace.setStackTrace(AbandonedTrace.java:160)
 at org.apache.tomcat.dbcp.dbcp.AbandonedObjectPool.borrowObject(AbandonedObjectPool.java:86)
 at org.apache.tomcat.dbcp.dbcp.PoolingDataSource.getConnection(PoolingDataSource.java:96)
 at org.apache.tomcat.dbcp.dbcp.BasicDataSource.getConnection(BasicDataSource.java:880)
 
DBCP object created 2010-12-11 11:08:00 by the following code was never closed:
java.lang.Exception
 at org.apache.tomcat.dbcp.dbcp.AbandonedTrace.init(AbandonedTrace.java:99)
 at org.apache.tomcat.dbcp.dbcp.AbandonedTrace.<init>(AbandonedTrace.java:82)
 at org.apache.tomcat.dbcp.dbcp.DelegatingStatement.<init>(DelegatingStatement.java:61)
 at org.apache.tomcat.dbcp.dbcp.DelegatingPreparedStatement.<init>(DelegatingPreparedStatement.java:66)
 at org.apache.tomcat.dbcp.dbcp.DelegatingConnection.prepareStatement(DelegatingConnection.java:262)
 at org.apache.tomcat.dbcp.dbcp.PoolingDataSource$PoolGuardConnectionWrapper.prepareStatement(PoolingDataSource.java:307)
 
分析:
这是removeAbandoned=true导致的,使用这个配置的时候将会使用AbandonedObjectPool.
而AbandonedObjectPool只在开发阶段使用,因为AbandonedObjectPool能帮你发现占用连接过长的代码.

log信息说明了getCustomerOnline占用连接超过removeAbandonedTimeout设定的时间.所以设置removeAbandoned=false就行了。
AbandonedObjectPool只在开发使用,在后续版本会去掉,现在api都deprecated了

相关热词搜索:DBCP object created by the following

上一篇:tomcat重启普通用户错误
下一篇:not found on the java.library.path 解决方案

分享到: 收藏
频道总排行
频道本月排行