java程序连接oracle数据库报错【WARN |ThreadPoolAsynchronousRunner$DeadlockDetector:608|com.mchange.v2.async.Th】

原创 2014年07月10日 11:05:59

今天工作中遇到一个问题,用户程序无法启动,报连接数据库异常:

错误日志分析如下:

|2014-07-09 16:58:08|WARN |ThreadPoolAsynchronousRunner$DeadlockDetector:608|com.mchange.v2.async.ThreadPoolAsynchronousRunner$DeadlockDetector@df0092 -- APPARENT DEADLOCK!!! Creating emergency threads for unassigned pending tasks! |
||2014-07-09 16:58:08|WARN |ThreadPoolAsynchronousRunner$DeadlockDetector:624|com.mchange.v2.async.ThreadPoolAsynchronousRunner$DeadlockDetector@df0092 -- APPARENT DEADLOCK!!! Complete Status: 
	Managed Threads: 3
	Active Threads: 3
	Active Tasks: 
		com.mchange.v2.resourcepool.BasicResourcePool$AcquireTask@18a3ddc (com.mchange.v2.async.ThreadPoolAsynchronousRunner$PoolThread-#2)
		com.mchange.v2.resourcepool.BasicResourcePool$AcquireTask@e371c6 (com.mchange.v2.async.ThreadPoolAsynchronousRunner$PoolThread-#0)
		com.mchange.v2.resourcepool.BasicResourcePool$AcquireTask@42bc2b (com.mchange.v2.async.ThreadPoolAsynchronousRunner$PoolThread-#1)
	Pending Tasks: 
		com.mchange.v2.resourcepool.BasicResourcePool$AcquireTask@14fb98b
		com.mchange.v2.resourcepool.BasicResourcePool$AcquireTask@11e8696
		com.mchange.v2.resourcepool.BasicResourcePool$AcquireTask@115ff26
		com.mchange.v2.resourcepool.BasicResourcePool$AcquireTask@122195f
		com.mchange.v2.resourcepool.BasicResourcePool$AcquireTask@1afb8dd
Pool thread stack traces:
	Thread[com.mchange.v2.async.ThreadPoolAsynchronousRunner$PoolThread-#2,5,main]
		java.net.Inet4AddressImpl.getHostByAddr(Native Method)
		java.net.InetAddress$1.getHostByAddr(InetAddress.java:842)
		java.net.InetAddress.getHostFromNameService(InetAddress.java:532)
		java.net.InetAddress.getHostName(InetAddress.java:475)
		java.net.InetAddress.getHostName(InetAddress.java:447)
		java.net.InetSocketAddress.getHostName(InetSocketAddress.java:210)
		java.net.SocksSocketImpl.connect(SocksSocketImpl.java:341)
		java.net.Socket.connect(Socket.java:507)
		java.net.Socket.connect(Socket.java:457)
		java.net.Socket.<init>(Socket.java:365)
		java.net.Socket.<init>(Socket.java:178)
		oracle.net.nt.TcpNTAdapter.connect(Unknown Source)
		oracle.net.nt.ConnOption.connect(Unknown Source)
		oracle.net.nt.ConnStrategy.execute(Unknown Source)
		oracle.net.resolver.AddrResolution.resolveAndExecute(Unknown Source)
		oracle.net.ns.NSProtocol.establishConnection(Unknown Source)
		oracle.net.ns.NSProtocol.connect(Unknown Source)
		oracle.jdbc.ttc7.TTC7Protocol.connect(TTC7Protocol.java:1687)
		oracle.jdbc.ttc7.TTC7Protocol.logon(TTC7Protocol.java:214)
		oracle.jdbc.driver.OracleConnection.<init>(OracleConnection.java:346)
		oracle.jdbc.driver.OracleDriver.getConnectionInstance(OracleDriver.java:468)
		oracle.jdbc.driver.OracleDriver.connect(OracleDriver.java:314)
		com.mchange.v2.c3p0.DriverManagerDataSource.getConnection(DriverManagerDataSource.java:134)
		com.mchange.v2.c3p0.WrapperConnectionPoolDataSource.getPooledConnection(WrapperConnectionPoolDataSource.java:182)
		com.mchange.v2.c3p0.WrapperConnectionPoolDataSource.getPooledConnection(WrapperConnectionPoolDataSource.java:171)
		com.mchange.v2.c3p0.impl.C3P0PooledConnectionPool$1PooledConnectionResourcePoolManager.acquireResource(C3P0PooledConnectionPool.java:137)
		com.mchange.v2.resourcepool.BasicResourcePool.doAcquire(BasicResourcePool.java:1014)
		com.mchange.v2.resourcepool.BasicResourcePool.access$800(BasicResourcePool.java:32)
		com.mchange.v2.resourcepool.BasicResourcePool$AcquireTask.run(BasicResourcePool.java:1810)
		com.mchange.v2.async.ThreadPoolAsynchronousRunner$PoolThread.run(ThreadPoolAsynchronousRunner.java:547)
	Thread[com.mchange.v2.async.ThreadPoolAsynchronousRunner$PoolThread-#0,5,main]
		java.net.Inet4AddressImpl.getHostByAddr(Native Method)
		java.net.InetAddress$1.getHostByAddr(InetAddress.java:842)
		java.net.InetAddress.getHostFromNameService(InetAddress.java:532)
		java.net.InetAddress.getHostName(InetAddress.java:475)
		java.net.InetAddress.getHostName(InetAddress.java:447)
		java.net.InetSocketAddress.getHostName(InetSocketAddress.java:210)
		java.net.SocksSocketImpl.connect(SocksSocketImpl.java:341)
		java.net.Socket.connect(Socket.java:507)
		java.net.Socket.connect(Socket.java:457)
		java.net.Socket.<init>(Socket.java:365)
		java.net.Socket.<init>(Socket.java:178)
		oracle.net.nt.TcpNTAdapter.connect(Unknown Source)
		oracle.net.nt.ConnOption.connect(Unknown Source)
		oracle.net.nt.ConnStrategy.execute(Unknown Source)
		oracle.net.resolver.AddrResolution.resolveAndExecute(Unknown Source)
		oracle.net.ns.NSProtocol.establishConnection(Unknown Source)
		oracle.net.ns.NSProtocol.connect(Unknown Source)
		oracle.jdbc.ttc7.TTC7Protocol.connect(TTC7Protocol.java:1687)
		oracle.jdbc.ttc7.TTC7Protocol.logon(TTC7Protocol.java:214)
		oracle.jdbc.driver.OracleConnection.<init>(OracleConnection.java:346)
		oracle.jdbc.driver.OracleDriver.getConnectionInstance(OracleDriver.java:468)
		oracle.jdbc.driver.OracleDriver.connect(OracleDriver.java:314)
		com.mchange.v2.c3p0.DriverManagerDataSource.getConnection(DriverManagerDataSource.java:134)
		com.mchange.v2.c3p0.WrapperConnectionPoolDataSource.getPooledConnection(WrapperConnectionPoolDataSource.java:182)
		com.mchange.v2.c3p0.WrapperConnectionPoolDataSource.getPooledConnection(WrapperConnectionPoolDataSource.java:171)
		com.mchange.v2.c3p0.impl.C3P0PooledConnectionPool$1PooledConnectionResourcePoolManager.acquireResource(C3P0PooledConnectionPool.java:137)
		com.mchange.v2.resourcepool.BasicResourcePool.doAcquire(BasicResourcePool.java:1014)
		com.mchange.v2.resourcepool.BasicResourcePool.access$800(BasicResourcePool.java:32)
		com.mchange.v2.resourcepool.BasicResourcePool$AcquireTask.run(BasicResourcePool.java:1810)
		com.mchange.v2.async.ThreadPoolAsynchronousRunner$PoolThread.run(ThreadPoolAsynchronousRunner.java:547)
	Thread[com.mchange.v2.async.ThreadPoolAsynchronousRunner$PoolThread-#1,5,main]
		java.net.Inet4AddressImpl.getHostByAddr(Native Method)
		java.net.InetAddress$1.getHostByAddr(InetAddress.java:842)
		java.net.InetAddress.getHostFromNameService(InetAddress.java:532)
		java.net.InetAddress.getHostName(InetAddress.java:475)
		java.net.InetAddress.getHostName(InetAddress.java:447)
		java.net.InetSocketAddress.getHostName(InetSocketAddress.java:210)
		java.net.SocksSocketImpl.connect(SocksSocketImpl.java:341)
		java.net.Socket.connect(Socket.java:507)
		java.net.Socket.connect(Socket.java:457)
		java.net.Socket.<init>(Socket.java:365)
		java.net.Socket.<init>(Socket.java:178)
		oracle.net.nt.TcpNTAdapter.connect(Unknown Source)
		oracle.net.nt.ConnOption.connect(Unknown Source)
		oracle.net.nt.ConnStrategy.execute(Unknown Source)
		oracle.net.resolver.AddrResolution.resolveAndExecute(Unknown Source)
		oracle.net.ns.NSProtocol.establishConnection(Unknown Source)
		oracle.net.ns.NSProtocol.connect(Unknown Source)
		oracle.jdbc.ttc7.TTC7Protocol.connect(TTC7Protocol.java:1687)
		oracle.jdbc.ttc7.TTC7Protocol.logon(TTC7Protocol.java:214)
		oracle.jdbc.driver.OracleConnection.<init>(OracleConnection.java:346)
		oracle.jdbc.driver.OracleDriver.getConnectionInstance(OracleDriver.java:468)
		oracle.jdbc.driver.OracleDriver.connect(OracleDriver.java:314)
		com.mchange.v2.c3p0.DriverManagerDataSource.getConnection(DriverManagerDataSource.java:134)
		com.mchange.v2.c3p0.WrapperConnectionPoolDataSource.getPooledConnection(WrapperConnectionPoolDataSource.java:182)
		com.mchange.v2.c3p0.WrapperConnectionPoolDataSource.getPooledConnection(WrapperConnectionPoolDataSource.java:171)
		com.mchange.v2.c3p0.impl.C3P0PooledConnectionPool$1PooledConnectionResourcePoolManager.acquireResource(C3P0PooledConnectionPool.java:137)
		com.mchange.v2.resourcepool.BasicResourcePool.doAcquire(BasicResourcePool.java:1014)
		com.mchange.v2.resourcepool.BasicResourcePool.access$800(BasicResourcePool.java:32)
		com.mchange.v2.resourcepool.BasicResourcePool$AcquireTask.run(BasicResourcePool.java:1810)
		com.mchange.v2.async.ThreadPoolAsynchronousRunner$PoolThread.run(ThreadPoolAsynchronousRunner.java:547)
分析原因:

造成程序启动失败的根本原因是数据库

可能性:

1、数据库连接池异常---尝试重启程序所在服务器

2、数据库连接配置错误(之前程序一直运行稳定正常,从未修改过数据库连接配置文件)----排除

3、数据库容量不足

4、数据库服务相关异常


经与客户共同排查,排查方式如下:

1、重启服务器释放资源,重启程序----仍然报如上错误

2、数据库空间正常

3、有其他程序能正常连接数据库,并无异常发生

---------------------------由上推断把可能性1、3、4都排除了


那么下面只剩下数据库连接配置问题了,(这怎么可能!用户未修改过用户名和密码,况且他们连配置文件存放位置都不知道)

说道配置文件中的数据库配置参数:

DRIVER、dialect、URL、user、password

不会变的有:DRIVER、dialect

那么考虑一下其他三个可能性,用户向我咨询了配置数据库的文件存放位置,找到了配置文件中数据库相关的配置参数

最后通过用户调查,查出问题的根本原因是数据库将用户上锁

至此问题排查结束,重启程序恢复正常

------------------------------------------------------

发表此博客就是为了勉励自己,遇到问题时有时候不仅仅要看经验或者是否遇到过

也不必急于查出问题,一一罗列出可能性(我取名叫散打法)虽然看是复杂但有的时候未免不是一种有效又条例清晰的方法,走的都是直线不会绕弯

不知道是否看过盗墓笔记中胖子曾多次使用这种方式解决了很多棘手问题。。。

C++模板的定制四:定制成员函数和缺省类参

  C++模板的定制四:定制成员函数和缺省类参一、             定制成员函数定制模板类成员函数,就是定义一个指定类型的类成员函数取代模板类定义的成员函数,实现特殊的功能,从而完成模板类成员...
  • winmain
  • winmain
  • 2001-11-24 10:25:00
  • 1114

com.mchange.v2.async.ThreadPoolAsynchronousRunner$DeadlockDetector.run 数据连接池死锁的问题

2015-03-26 15:52:17,017--[Timer-1hread]--WARN --com.mchange.v2.async.ThreadPoolAsynchronousRunner$De...
  • dingxingmei
  • dingxingmei
  • 2015-03-26 18:14:05
  • 4516

警告: com.mchange.v2.async.ThreadPoolAsynchronousRunner$DeadlockDetector@21eb3f -- APPARENT DEADLOCK!!

警告: com.mchange.v2.async.ThreadPoolAsynchronousRunner$DeadlockDetector@21eb3f -- APPARENT DEADLOCK!...
  • Truong
  • Truong
  • 2013-07-26 10:23:55
  • 42845

com.mchange.v2.async.ThreadPoolAsynchronousRunner$DeadlockDetector@1035079

com.mchange.v2.async.ThreadPoolAsynchronousRunner$DeadlockDetector@1035079 -- APPARENT DEADLOCK!!! C...
  • yuzhongzi81
  • yuzhongzi81
  • 2014-12-08 17:57:36
  • 5058

警告: com.mchange.v2.async.ThreadPoolAsynchronousRunner$DeadlockDetector@513098 -- APPARENT DEADLOCK!!

当我们在配置成 p出现以下这些错误:
  • chenchudongsg
  • chenchudongsg
  • 2014-06-02 09:45:48
  • 3168

Tomcat启动项目出现com.mchange.v2.async.ThreadPoolAsynchronousRunner$DeadlockDetector错误

警告: com.mchange.v2.async.ThreadPoolAsynchronousRunner$DeadlockDetector@21eb3f -- APPARENT DEADLOCK...
  • qq_33075157
  • qq_33075157
  • 2016-12-02 10:08:36
  • 7167

com.mchange.v2.async.ThreadPoolAsynchronousRunner$DeadlockDetector@1c023d89 -- APPARENT DEADLOCK!!!

完整问题没法复现了,导致的结果就是数据库连接不上,猜测可能是之前的操作导致数据库死锁进而导致数据库服务停止,如果不是这个原因可能需要其他解决方法。我的解决方法:查看任务管理器中MYSQL服务是否启动,...
  • u013794793
  • u013794793
  • 2017-09-14 09:10:06
  • 227

【error】Tomcat启动报错com.mchange.v2.async.ThreadPoolAsynchronousRunner$DeadlockDetector

 原文链接:Tomcat启动项目出现com.mchange.v2.async.ThreadPoolAsynchronousRunner$DeadlockDetector错误错误信息2015-6-22 ...
  • xn_28
  • xn_28
  • 2017-04-04 21:03:56
  • 3777

在Tomcat的server.xml中配置两个context,出现其中一个不能正常启动,交换配置顺序,另一个又不能正常启动,即始终只有第二个配置能启动的情况。如果单独部署,都没有问题。报错大致内容如下

在Tomcat的server.xml中配置两个context,出现其中一个不能正常启动,交换配置顺序,另一个又不能正常启动,即始终只有第二个配置能启动的情况。如果单独部署,都没有问题。报错大致内容如下...
  • qq_29290295
  • qq_29290295
  • 2017-12-10 13:21:42
  • 447

com.mchange.v2.async.ThreadPoolAsynchronousRunner$DeadlockDetector@d3ade7 ,项目启动错误

在用hibernate,spring,struts,3个框架的做项目的时候,运行tomcat,报了下面一推错误:  [0629 18:12:30 285 WARN ]     ThreadPoolAs...
  • kevingavinhu
  • kevingavinhu
  • 2011-06-29 18:15:00
  • 22027
收藏助手
不良信息举报
您举报文章:java程序连接oracle数据库报错【WARN |ThreadPoolAsynchronousRunner$DeadlockDetector:608|com.mchange.v2.async.Th】
举报原因:
原因补充:

(最多只允许输入30个字)