Druid出现DruidDataSource - recyle error - recyle error java.lang.InterruptedException: null异常排查与解决

线上的代码之前运行的都很平稳,突然就出现了一个很奇怪的问题,看错误信息是第三方框架Druid报出来了,连接池回收连接时出现的问题。

2018-05-14 20:01:32.810 ERROR [hystrix-UpgradeResultReportController-49][DruidDataSource.java:1297] - recyle error
java.lang.InterruptedException: null
        at java.util.concurrent.locks.AbstractQueuedSynchronizer.acquireInterruptibly(AbstractQueuedSynchronizer.java:1220) ~[?:1.8.0_131]
        at java.util.concurrent.locks.ReentrantLock.lockInterruptibly(ReentrantLock.java:335) ~[?:1.8.0_131]
        at com.alibaba.druid.pool.DruidDataSource.recycle(DruidDataSource.java:1279) [druid-1.0.11.jar!/:1.0.11]
        at com.alibaba.druid.pool.DruidPooledConnection.recycle(DruidPooledConnection.java:292) [druid-1.0.11.jar!/:1.0.11]
        at com.alibaba.druid.filter.FilterChainImpl.dataSource_recycle(FilterChainImpl.java:4534) [druid-1.0.11.jar!/:1.0.11]
        at com.alibaba.druid.filter.FilterAdapter.dataSource_releaseConnection(FilterAdapter.java:2717) [druid-1.0.11.jar!/:1.0.11]
        at com.alibaba.druid.filter.FilterChainImpl.dataSource_recycle(FilterChainImpl.java:4530) [druid-1.0.11.jar!/:1.0.11]
        at com.alibaba.druid.filter.stat.StatFilter.dataSource_releaseConnection(StatFilter.java:646) [druid-1.0.11.jar!/:1.0.11]
        at com.alibaba.druid.filter.FilterChainImpl.dataSource_recycle(FilterChainImpl.java:4530) [druid-1.0.11.jar!/:1.0.11]
        at com.alibaba.druid.pool.DruidPooledConnection.syncClose(DruidPooledConnection.java:269) [druid-1.0.11.jar!/:1.0.11]
        at com.alibaba.druid.pool.DruidPooledConnection.close(DruidPooledConnection.java:228) [druid-1.0.11.jar!/:1.0.11]
        at org.springframework.jdbc.datasource.DataSourceUtils.doCloseConnection(DataSourceUtils.java:341) [spring-jdbc-4.3.8.RELEASE.jar!/:4.3.8.RELEASE]
        at org.springframework.jdbc.datasource.DataSourceUtils.doReleaseConnection(DataSourceUtils.java:328) [spring-jdbc-4.3.8.RELEASE.jar!/:4.3.8.RELEASE]
        at org.springframework.jdbc.datasource.DataSourceUtils.releaseConnection(DataSourceUtils.java:294) [spring-jdbc-4.3.8.RELEASE.jar!/:4.3.8.RELEASE]
        at org.mybatis.spring.transaction.SpringManagedTransaction.close(SpringManagedTransaction.java:127) [mybatis-spring-1.3.1.jar!/:1.3.1]
        at org.apache.ibatis.executor.BaseExecutor.close(BaseExecutor.java:90) [mybatis-3.4.2.jar!/:3.4.2]
        at org.apache.ibatis.executor.CachingExecutor.close(CachingExecutor.java:64) [mybatis-3.4.2.jar!/:3.4.2]
        at org.apache.ibatis.session.defaults.DefaultSqlSession.close(DefaultSqlSession.java:264) [mybatis-3.4.2.jar!/:3.4.2]
        at org.mybatis.spring.SqlSessionUtils.closeSqlSession(SqlSessionUtils.java:193) [mybatis-spring-1.3.1.jar!/:1.3.1]
        at org.mybatis.spring.SqlSessionTemplate$SqlSessionInterceptor.invoke(SqlSessionTemplate.java:454) [mybatis-spring-1.3.1.jar!/:1.3.1]
        at com.sun.proxy.$Proxy133.update(Unknown Source) [?:?]
        at org.mybatis.spring.SqlSessionTemplate.update(SqlSessionTemplate.java:294) [mybatis-spring-1.3.1.jar!/:1.3.1]
        at org.apache.ibatis.binding.MapperMethod.execute(MapperMethod.java:62) [mybatis-3.4.2.jar!/:3.4.2]
        at org.apache.ibatis.binding.MapperProxy.invoke(MapperProxy.java:59) [mybatis-3.4.2.jar!/:3.4.2]
        at com.sun.proxy.$Proxy148.updDeviceUpgradeStatus(Unknown Source) [?:?]
        at com.phicomm.smarthome.ota.service.impl.UpgradeHistoryDaoServiceImpl.updUpgradeSuccessStatus(UpgradeHistoryDaoServiceImpl.java:50R [classes!/:0.0.1-SNAPSHOT]
        at com.phicomm.smarthome.ota.service.impl.UpgradeHistoryDaoServiceImpl$$FastClassBySpringCGLIB$$9b468fba.invoke(<generated>) [classes!/:0.0.1-SNAPSHOT]
        at org.springframework.cglib.proxy.MethodProxy.invoke(MethodProxy.java:204) [spring-core-4.3.8.RELEASE.jar!/:4.3.8.RELEASE]
        at org.springframework.aop.framework.CglibAopProxy$CglibMethodInvocation.invokeJoinpoint(CglibAopProxy.java:738) [spring-aop-4.3.8.RELEASE.jar!/:4.3.8.RELEASE]

查看一下他的源码

看了一下也没有发现所以然,然后去GitHub上的Druid官方开源处,看了一下历史问题修复,发现这个是旧版本已知的一个Bug。

https://github.com/alibaba/druid/issues/785

看了一下当前使用的Druid的版本【1.0.11】,然后又确认了一下官方最新的版本是【1.1.9】,已经差了很多个版本了。

果断将版本更新至最新

<dependency>
	<groupId>com.alibaba</groupId>
	<artifactId>druid</artifactId>
	<version>1.1.9</version>
</dependency>

翻看之前出错的那里的代码发现

更新到最新版本后,上述问题得到解决。

  

原文地址:https://www.cnblogs.com/lingyejun/p/9064114.html

时间: 2024-10-12 02:24:00

Druid出现DruidDataSource - recyle error - recyle error java.lang.InterruptedException: null异常排查与解决的相关文章

启动eureka工程报java.lang.AbstractMethodError: null异常

java.lang.AbstractMethodError: null at org.springframework.core.OrderComparator.findOrder(OrderComparator.java:142) ~[spring-core-5.0.7.RELEASE.jar:5.0.7.RELEASE] at org.springframework.core.annotation.AnnotationAwareOrderComparator.findOrder(Annotat

排查sqoop报错:Error running child : java.lang.OutOfMemoryError: Java heap space

报错栈: 2017-06-16 19:50:51,002 INFO [main] org.apache.hadoop.mapred.MapTask: Processing split: 1=1 AND 1=1 2017-06-16 19:50:51,043 INFO [main] org.apache.sqoop.mapreduce.db.DBRecordReader: Working on split: 1=1 AND 1=1 2017-06-16 19:50:51,095 INFO [mai

JMeter命令行执行及问题解决 Error in NonGUIDriver java.lang.RuntimeException: Could not find the TestPlan class!

下面介绍的是在windows环境下如何运行jmeter linux 命令相同 1.首先要准备好脚本,并且设置好线程属性,假设我们设置一个线程,循环一次. 2.打开cmd命令行,到jmeter的bin目录下 3.输入: jmeter -n -t  首页改版.jmx -l  result/10.jtl 回车,等待运行结束 参数说明: -n  指jmeter在无GUI的形式下运行: -t   指定要运行的脚本,如上图的:首页改版.jmx -l    指定一个jtl文件存放运行结果,如:result/1

hive分区导致FAILED: Hive Internal Error: java.lang.NullPointerException(null)

写了一条hive sql ,其中条件中存在 dt>=20150101 and dt<=20150228 这样的条件,原来执行没问题,今天就抛出 FAILED: Hive Internal Error: java.lang.NullPointerException(null)java.lang.NullPointerException at org.apache.hadoop.hive.ql.optimizer.pcr.PcrExprProcFactory.opAnd(PcrExprProcFa

关于jmeter命令行执行.jmx文件出现Error in NonGUIDriver java.lang.RuntimeException: Could not find the TestPlan class的问题

jmeter命令行执行.jmx文件时,有时回出现Error in NonGUIDriver java.lang.RuntimeException: Could not find the TestPlan class的错误 目前出现此错误的原因是在jmeter3.0及以下版本存在bug 对于使用UI界面生成.jmx时,请在testplan层做保存,而非在threads层做保存,如下图

jmeter linux压测报错:Error in NonGUIDriver java.lang.IllegalArgumentException: Problem loading XML from:&#39;/home/server/ptest/disk_out.jmx&#39;.

1.linux环境jmeter与win环境编写脚本的jmeter版本不一致,版本改为一致 2.脚本中存在中文,去除中文 3.脚本中存在类似于[email protected] - Active Threads Over Time 监听器,去除监听器(查看结果树和聚合报告可以保留) 再次上传至服务器压测 jmeter linux压测报错:Error in NonGUIDriver java.lang.IllegalArgumentException: Problem loading XML fro

Maven打包时出现“Show Console View”错误弹出框,错误详情为“An internal error has occurred. java.lang.NullPointerException”的解决方法

今天为项目打包时出现了下面的错误提示: 打开Details里面写的是“An internal error has occurred. java.lang.NullPointerException”.在网上搜索了一下,找到了解决方法,特此记录一下. 解决方法: 1.关闭eclipse等开发环境: 2.找到对应工程所在工作空间的配置文件.metadata,按照下面路径:*\.metadata\.plugins\org.eclipse.core.runtime\.settings,把settings文

java.lang.NoClassDefFoundError: org/hibernate/cfg/Configuration解决方法

Autowiring of fields failed; nested exception is...........Error creating bean with name 'siteOperaterFactory': Autowiring of fields fa ...........java.lang.NoClassDefFoundError: org/hibernate/cfg/Configuratio 看开头是以为是创建siteOperaterFactory实例出的错,再看后面,原

Java.lang.NoSuchFieldError: INSTANCE异常

解决方案: java.lang.NoSuchFieldError: INSTANCE异常. 1.jar包重复了. 2.版本还不相同,如果包的版本不同也会报相应的错,不过一般情况自己导入的jar包主要看导入有没有共同范围下有重复的jar. 仅供参考,大神高论,评论下方. Java.lang.NoSuchFieldError: INSTANCE异常