随笔-10  评论-23  文章-32  trackbacks-0

这是我换了数据库以后报的错误:

INFO 23:09:16,296 ConnectionProviderFactory:72 - Initializing connection provider: org.springframework.orm.hibernate3.LocalDataSourceConnectionProvider
WARN 23:09:36,375 ThreadPoolAsynchronousRunner:608 - com.mchange.v2.async.ThreadPoolAsynchronousRunner$DeadlockDetector@13cb6cf -- APPARENT DEADLOCK!!! Creating emergency threads for unassigned pending tasks!
WARN 23:09:36,390 ThreadPoolAsynchronousRunner:624 - com.mchange.v2.async.ThreadPoolAsynchronousRunner$DeadlockDetector@13cb6cf -- APPARENT DEADLOCK!!! Complete Status:
Managed Threads: 3
Active Threads: 3
Active Tasks:
com.mchange.v2.resourcepool.BasicResourcePool$AcquireTask@1b65d47 (com.mchange.v2.async.ThreadPoolAsynchronousRunner$PoolThread-#1)
com.mchange.v2.resourcepool.BasicResourcePool$AcquireTask@1a61582 (com.mchange.v2.async.ThreadPoolAsynchronousRunner$PoolThread-#2)
com.mchange.v2.resourcepool.BasicResourcePool$AcquireTask@ce4625 (com.mchange.v2.async.ThreadPoolAsynchronousRunner$PoolThread-#0)
Pending Tasks:
com.mchange.v2.resourcepool.BasicResourcePool$AcquireTask@5f5deb
com.mchange.v2.resourcepool.BasicResourcePool$AcquireTask@10ef5a5
Pool thread stack traces:
Thread[com.mchange.v2.async.ThreadPoolAsynchronousRunner$PoolThread-#1,5,main]
java.net.PlainSocketImpl.socketConnect(Native Method)
java.net.PlainSocketImpl.doConnect(PlainSocketImpl.java:333)
java.net.PlainSocketImpl.connectToAddress(PlainSocketImpl.java:195)
java.net.PlainSocketImpl.connect(PlainSocketImpl.java:182)
java.net.SocksSocketImpl.connect(SocksSocketImpl.java:366)
java.net.Socket.connect(Socket.java:519)
java.net.Socket.connect(Socket.java:469)
java.net.Socket.<init>(Socket.java:366)
java.net.Socket.<init>(Socket.java:180)
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.driver.T4CConnection.connect(T4CConnection.java:844)
oracle.jdbc.driver.T4CConnection.logon(T4CConnection.java:268)
oracle.jdbc.driver.PhysicalConnection.<init>(PhysicalConnection.java:414)
oracle.jdbc.driver.T4CConnection.<init>(T4CConnection.java:165)
oracle.jdbc.driver.T4CDriverExtension.getConnection(T4CDriverExtension.java:35)
oracle.jdbc.driver.OracleDriver.connect(OracleDriver.java:801)
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-#2,5,main]
java.net.PlainSocketImpl.socketConnect(Native Method)
java.net.PlainSocketImpl.doConnect(PlainSocketImpl.java:333)
java.net.PlainSocketImpl.connectToAddress(PlainSocketImpl.java:195)
java.net.PlainSocketImpl.connect(PlainSocketImpl.java:182)
java.net.SocksSocketImpl.connect(SocksSocketImpl.java:366)
java.net.Socket.connect(Socket.java:519)
java.net.Socket.connect(Socket.java:469)
java.net.Socket.<init>(Socket.java:366)
java.net.Socket.<init>(Socket.java:180)
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.driver.T4CConnection.connect(T4CConnection.java:844)
oracle.jdbc.driver.T4CConnection.logon(T4CConnection.java:268)
oracle.jdbc.driver.PhysicalConnection.<init>(PhysicalConnection.java:414)
oracle.jdbc.driver.T4CConnection.<init>(T4CConnection.java:165)
oracle.jdbc.driver.T4CDriverExtension.getConnection(T4CDriverExtension.java:35)
oracle.jdbc.driver.OracleDriver.connect(OracleDriver.java:801)
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.PlainSocketImpl.socketConnect(Native Method)
java.net.PlainSocketImpl.doConnect(PlainSocketImpl.java:333)
java.net.PlainSocketImpl.connectToAddress(PlainSocketImpl.java:195)
java.net.PlainSocketImpl.connect(PlainSocketImpl.java:182)
java.net.SocksSocketImpl.connect(SocksSocketImpl.java:366)
java.net.Socket.connect(Socket.java:519)
java.net.Socket.connect(Socket.java:469)
java.net.Socket.<init>(Socket.java:366)
java.net.Socket.<init>(Socket.java:180)
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.driver.T4CConnection.connect(T4CConnection.java:844)
oracle.jdbc.driver.T4CConnection.logon(T4CConnection.java:268)
oracle.jdbc.driver.PhysicalConnection.<init>(PhysicalConnection.java:414)
oracle.jdbc.driver.T4CConnection.<init>(T4CConnection.java:165)
oracle.jdbc.driver.T4CDriverExtension.getConnection(T4CDriverExtension.java:35)
oracle.jdbc.driver.OracleDriver.connect(OracleDriver.java:801)
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)
原因:网上多是说c3p0 bug引起的
我的数据库oracle 10.2.0.1,oracle14.jar也是10.2.0.1版本,我做了两个修改这个错误就没有了,具体原因还不明,先解决了再说。
一.修改数据库方言为oracle.jdbc.driver.OracleDriver(原来为oracle.jdbc.OracleDriver 在linux上也可以使用的)
二.修改数据库的最大连接数,见:http://www.blogjava.net/zhip/archive/2008/05/16/200769.html
posted on 2009-09-28 23:19 liuyimx 阅读(27110) 评论(6)  编辑  收藏

评论:
# re: c3po异常:Creating emergency threads for unassigned pending tasks! 2009-11-04 11:28 | zwh
首先尝试解决数据库的链接问题,既然出错信息报告unknown source,说明数据库没有链接上,可检查1链接串是否正确,2数据库服务是否已经启动,  回复  更多评论
  
# re: c3po异常:Creating emergency threads for unassigned pending tasks! 2009-11-04 11:42 | zwh
@zwh
还有3,检查数据库用户名和密码是否正确。如果用代码测试数据库可以链接上,那么这个问题应该不会再出现。  回复  更多评论
  
# re: c3po异常:Creating emergency threads for unassigned pending tasks![未登录] 2012-10-29 16:16 | zp
我们的服务器天天都报这个警告,跟你的信息基本一致。很奇怪,这究竟是什么原因引起的?能否解释一下啊?数据库的连接以及用户密码都没问题。目前数据库支持的最大连接数是2000,c3po设置100。
leo_soul@126.com
如有什么消息,麻烦发个邮件通知一下。谢谢  回复  更多评论
  
# re: c3po异常:Creating emergency threads for unassigned pending tasks![未登录] 2012-11-14 10:36 | zp
我找到原因了,原来是做过系统集群,有多台集群服务器,在同一时间触发一个insert操作,导致冲突。  回复  更多评论
  
# re: c3po异常:Creating emergency threads for unassigned pending tasks! 2013-05-03 17:37 | 嘎嘎嘎嘎
@zwh
嘎嘎嘎嘎  回复  更多评论
  
# re: c3po异常:Creating emergency threads for unassigned pending tasks! 2013-05-20 15:02 | rebel
@zp
解决方法呢?  回复  更多评论
  

只有注册用户登录后才能发表评论。


网站导航: