Tomcat报错:DBCP object created 2012-03-03 09:09:34 by the following code was never close

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)
这是removeAbandoned=true导致的,使用这个配置的时候将会使用AbandonedObjectPool. 
而AbandonedObjectPool只在开发阶段使用,因为AbandonedObjectPool能帮你发现占用连接过长的代码
log信息说明了getCustomerOnline占用连接超过removeAbandonedTimeout设定的时间.所以设置removeAbandoned=false就行了。

转载于:https://www.cnblogs.com/jenliy/archive/2012/03/03/2378319.html

  • 0
    点赞
  • 0
    评论
  • 0
    收藏
  • 一键三连
    一键三连
  • 扫一扫,分享海报

表情包
插入表情
评论将由博主筛选后显示,对所有人可见 | 还能输入1000个字符
©️2021 CSDN 皮肤主题: 编程工作室 设计师:CSDN官方博客 返回首页
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

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

余额充值