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

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

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

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

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

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

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

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

WARN ThreadPoolAsynchronousRunner:608问题解决

今天开发项目启动tomcat的时候报出如下错误:
  • u013953289
  • u013953289
  • 2014年08月13日 17:11
  • 2020

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

在用hibernate,spring,struts,3个框架的做项目的时候,运行tomcat,报了下面一推错误: [0629 18:12:30 285 WARN ]     ThreadPoolAs...
  • smh821025
  • smh821025
  • 2015年07月16日 12:19
  • 2702

警告: 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
  • 40209

【OCJP】 第2题---Set中subSet()方法的运用

本题主要考查: 1、TreeSet 自然排序 2、subSet()方法的运用
  • yingpaixiaochuan
  • yingpaixiaochuan
  • 2015年10月10日 09:43
  • 406

WINCE下ActiveSync连接故障分析

WINCE下ActiveSync连接故障分析           WinCE使用USB口与PC连接,并通过ActiveSync实现远程文件浏览,注册表,进程,编译调试等功能。对于ActiveSyn...
  • wuyusheng314
  • wuyusheng314
  • 2017年02月18日 14:55
  • 167

upstream均衡负载模块(一)加权轮询策略

upstream负载均衡模块主要是用于从“upstream”定义的后端服务器中选择一台服务器进行连接。nginx先使用负载均衡模块选择一台主机,再使用upstream模块实现与这台主机的交互。 负载...
  • ws891033655
  • ws891033655
  • 2014年05月14日 22:55
  • 699

WARN com.opensymphony.xwork2.ognl.OgnlValueStack异常的解决办法[提交按钮使用了图片并设置name属性,对应action无gettersetter]

文章来源:http://hi.baidu.com/gpsdreamer/item/544050ed0e00e4d0e1a5d4cd WARN com.opensymphony.xwork2.og...
  • buster2014
  • buster2014
  • 2015年01月23日 15:55
  • 629

nyoj 608 畅通工程

畅通工程 时间限制:2000 ms  |  内存限制:65535 KB 难度:3 描述某省调查城镇交通状况,得到现有城镇道路统计表,表中列出了每条道路直接连通的城镇。省政府“畅通工程”的目标是...
  • hlg1995
  • hlg1995
  • 2017年04月15日 15:42
  • 68

Hadoop异常合集(更新中~)

java.io.FileNotFoundException: File file does notError LogException in thread "main" java.io.FileNot...
  • u011239443
  • u011239443
  • 2016年07月04日 20:43
  • 2299

配置Log4j(很详细)

http://www.blogjava.net/zJun/archive/2006/06/28/55511.html Log4J的配置文件(Configuration File)就是用来设置记录...
  • gogl
  • gogl
  • 2015年09月20日 00:01
  • 345
内容举报
返回顶部
收藏助手
不良信息举报
您举报文章:java程序连接oracle数据库报错【WARN |ThreadPoolAsynchronousRunner$DeadlockDetector:608|com.mchange.v2.async.Th】
举报原因:
原因补充:

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