报错信息:
inas] 2019-01-11 10:15:59,955 WARN [C3P0PooledConnectionPoolManager[identityToken->2zioz0a0ga5qw7onzyne|10cbafaa]-AdminTaskTimer] ThreadPoolAsynchronousRunner.log(211) | com.mchange.v2.async.ThreadPoolAsynchronousRunner$DeadlockDetector@31e30824 -- APPARENT DEADLOCK!!! Creating emergency threads for unassigned pending tasks! [inas] 2019-01-11 10:15:59,960 WARN [C3P0PooledConnectionPoolManager[identityToken->2zioz0a0ga5qw7onzyne|10cbafaa]-AdminTaskTimer] ThreadPoolAsynchronousRunner.log(211) | com.mchange.v2.async.ThreadPoolAsynchronousRunner$DeadlockDetector@31e30824 -- APPARENT DEADLOCK!!! Complete Status: Managed Threads: 3 Active Threads: 3 Active Tasks: com.mchange.v2.resourcepool.BasicResourcePool$ScatteredAcquireTask@18ca9de8 on thread: C3P0PooledConnectionPoolManager[identityToken->2zioz0a0ga5qw7onzyne|10cbafaa]-HelperThread-#0 com.mchange.v2.resourcepool.BasicResourcePool$1DestroyResourceTask@760baa7c on thread: C3P0PooledConnectionPoolManager[identityToken->2zioz0a0ga5qw7onzyne|10cbafaa]-HelperThread-#2 com.mchange.v2.resourcepool.BasicResourcePool$1DestroyResourceTask@77e5ef6f on thread: C3P0PooledConnectionPoolManager[identityToken->2zioz0a0ga5qw7onzyne|10cbafaa]-HelperThread-#1 Pending Tasks: com.mchange.v2.resourcepool.BasicResourcePool$ScatteredAcquireTask@1e44f70f Pool thread stack traces: Thread[C3P0PooledConnectionPoolManager[identityToken->2zioz0a0ga5qw7onzyne|10cbafaa]-HelperThread-#2,5,main] java.net.SocketInputStream.socketRead0(Native Method) java.net.SocketInputStream.read(SocketInputStream.java:152) java.net.SocketInputStream.read(SocketInputStream.java:122) oracle.net.ns.Packet.receive(Unknown Source) oracle.net.ns.DataPacket.receive(Unknown Source) oracle.net.ns.NetInputStream.getNextPacket(Unknown Source) oracle.net.ns.NetInputStream.read(Unknown Source) oracle.net.ns.NetInputStream.read(Unknown Source) oracle.net.ns.NetInputStream.read(Unknown Source) oracle.jdbc.driver.T4CMAREngine.unmarshalUB1(T4CMAREngine.java:1104) oracle.jdbc.driver.T4CMAREngine.unmarshalSB1(T4CMAREngine.java:1075) oracle.jdbc.driver.T4C7Ocommoncall.receive(T4C7Ocommoncall.java:106) oracle.jdbc.driver.T4CConnection.logoff(T4CConnection.java:465) oracle.jdbc.driver.PhysicalConnection.close(PhysicalConnection.java:1203) com.mchange.v2.c3p0.impl.NewPooledConnection.close(NewPooledConnection.java:642) com.mchange.v2.c3p0.impl.NewPooledConnection.closeMaybeCheckedOut(NewPooledConnection.java:255) com.mchange.v2.c3p0.impl.C3P0PooledConnectionPool$1PooledConnectionResourcePoolManager.destroyResource(C3P0PooledConnectionPool.java:621) com.mchange.v2.resourcepool.BasicResourcePool$1DestroyResourceTask.run(BasicResourcePool.java:1065) com.mchange.v2.async.ThreadPoolAsynchronousRunner$PoolThread.run(ThreadPoolAsynchronousRunner.java:696) Thread[C3P0PooledConnectionPoolManager[identityToken->2zioz0a0ga5qw7onzyne|10cbafaa]-HelperThread-#1,5,main] java.net.SocketInputStream.socketRead0(Native Method) java.net.SocketInputStream.read(SocketInputStream.java:152) java.net.SocketInputStream.read(SocketInputStream.java:122) oracle.net.ns.Packet.receive(Unknown Source) oracle.net.ns.DataPacket.receive(Unknown Source) oracle.net.ns.NetInputStream.getNextPacket(Unknown Source) oracle.net.ns.NetInputStream.read(Unknown Source) oracle.net.ns.NetInputStream.read(Unknown Source) oracle.net.ns.NetInputStream.read(Unknown Source) oracle.jdbc.driver.T4CMAREngine.unmarshalUB1(T4CMAREngine.java:1104) oracle.jdbc.driver.T4CMAREngine.unmarshalSB1(T4CMAREngine.java:1075) oracle.jdbc.driver.T4C7Ocommoncall.receive(T4C7Ocommoncall.java:106) oracle.jdbc.driver.T4CConnection.logoff(T4CConnection.java:465) oracle.jdbc.driver.PhysicalConnection.close(PhysicalConnection.java:1203) com.mchange.v2.c3p0.impl.NewPooledConnection.close(NewPooledConnection.java:642) com.mchange.v2.c3p0.impl.NewPooledConnection.closeMaybeCheckedOut(NewPooledConnection.java:255) com.mchange.v2.c3p0.impl.C3P0PooledConnectionPool$1PooledConnectionResourcePoolManager.destroyResource(C3P0PooledConnectionPool.java:621) com.mchange.v2.resourcepool.BasicResourcePool$1DestroyResourceTask.run(BasicResourcePool.java:1065) com.mchange.v2.async.ThreadPoolAsynchronousRunner$PoolThread.run(ThreadPoolAsynchronousRunner.java:696) Thread[C3P0PooledConnectionPoolManager[identityToken->2zioz0a0ga5qw7onzyne|10cbafaa]-HelperThread-#0,5,main] java.net.SocketInputStream.socketRead0(Native Method) java.net.SocketInputStream.read(SocketInputStream.java:152) java.net.SocketInputStream.read(SocketInputStream.java:122) oracle.net.ns.Packet.receive(Unknown Source) oracle.net.ns.NSProtocol.connect(Unknown Source) oracle.jdbc.driver.T4CConnection.connect(T4CConnection.java:856) oracle.jdbc.driver.T4CConnection.logon(T4CConnection.java:268) oracle.jdbc.driver.PhysicalConnection.<init>(PhysicalConnection.java:439) 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:172) com.mchange.v2.c3p0.WrapperConnectionPoolDataSource.getPooledConnection(WrapperConnectionPoolDataSource.java:220) com.mchange.v2.c3p0.WrapperConnectionPoolDataSource.getPooledConnection(WrapperConnectionPoolDataSource.java:206) com.mchange.v2.c3p0.impl.C3P0PooledConnectionPool$1PooledConnectionResourcePoolManager.acquireResource(C3P0PooledConnectionPool.java:200) com.mchange.v2.resourcepool.BasicResourcePool.doAcquire(BasicResourcePool.java:1127) com.mchange.v2.resourcepool.BasicResourcePool.doAcquireAndDecrementPendingAcquiresWithinLockOnSuccess(BasicResourcePool.java:1114) com.mchange.v2.resourcepool.BasicResourcePool.access$800(BasicResourcePool.java:44) com.mchange.v2.resourcepool.BasicResourcePool$ScatteredAcquireTask.run(BasicResourcePool.java:1855) com.mchange.v2.async.ThreadPoolAsynchronousRunner$PoolThread.run(ThreadPoolAsynchronousRunner.java:696) [inas] 2019-01-11 10:16:03,779 INFO [http-bio-9090-exec-20] JdbcFTemplate.?(?) | ifId[srpt-cfg-menuQueryAsync]-sql[select ID_ "id_",NAME_ "name_",TYPE_ "type_" ,enabled "enabled",creator_ "creator" from dm_co_ba_srpt_menu t where PARENT_ID = '0' and enabled in('1','2','3','4') order by ID_],sqlParseUseTime[3ms] [inas] 2019-01-11 10:16:03,874 DEBUG [http-bio-9090-exec-20] SmlServletBean.?(?) | sml request method[POST]-uri[/INAS/sml/query/srpt-enum-dataSource] [inas] 2019-01-11 10:16:03,911 INFO [http-bio-9090-exec-20] JdbcFTemplate.?(?) | ifId[srpt-enum-dataSource]-sql[SELECT t.id_ "id_" ,t.name_ "name_" FROM DM_CO_BA_SRPT_DATA_SOURCE t order by id_ desc],sqlParseUseTime[0ms] ^C
问题来源过程:
1.过段时间突然出现线程死锁,
2.有时候启动也报这种错误。
问题分析:
1.数据库连接不上,
2,数据库负荷过高,
3.线程池配置不符合。
4.c3p0版本太低。
问题解决: