gang_qi_xi_2 2020-08-21 15:57 采纳率: 50%
浏览 649
已采纳

一个服务器上的系统连接另一个服务器上的数据库,报java.lang.InterruptedException错误,该如何处理?

一个服务器上的系统连接另一个服务器上的数据库,运行报错;

数据库分别为SICS、IWRS,具体见config.xml

图片说明

部分代码,如下:

public UserInfo selectUserByUserID(String userID) throws Exception{

    System.out.println("1111111--------");
    UserInfo user = null;
    List<UserInfo> users = null;
    DBOperator dbo = getDBOperator("IWRS");
    System.out.println("userID-000----"+userID);
    try {
        users = new UserInfoTableAdapter(dbo).select(" USER_ID='"+userID+"'");
        if (users != null && users.size() > 0) {
            user = users.get(0);
        }
        dbo.commit();
    } catch (Exception e) {
        e.printStackTrace();
        dbo.rollback();
        throw e;
    } finally {
        dbo.close();
    }
    return user;
}

报错日志,如下:

[20-8-21 14:11:53:507 CST] 0000002f SystemOut O 1111111--------

[20-8-21 14:11:53:508 CST] 0000002f SystemOut O 2020-08-21 14:11:53.508 533f533f I:

dataSource=< DataSource>< Name>IWRS< /Name>< JNDI>< /JNDI>< Driver>oracle.jdbc.driver.OracleDriver< /Driver>< URL>jdbc:oracle:thin:@1*.1*.*.249:1521:HTGCP< /URL>< User>******< /User>< Password>******< /Password>< SchemaMappings>< Name>GCP< /Name>< Value>IWRS< /Value>< /SchemaMappings>< /DataSource>

[20-8-21 14:11:53:543 CST] 0000002f AbstractPoolB I com.mchange.v2.c3p0.impl.AbstractPoolBackedDataSource getPoolManager Initializing c3p0 pool... com.mchange.v2.c3p0.ComboPooledDataSource [ acquireIncrement -> 3, acquireRetryAttempts -> 30, acquireRetryDelay -> 1000, autoCommitOnClose -> false, automaticTestTable -> null, breakAfterAcquireFailure -> false, checkoutTimeout -> 0, connectionCustomizerClassName -> null, connectionTesterClassName -> com.mchange.v2.c3p0.impl.DefaultConnectionTester, dataSourceName -> 2v242rac4c7k07f7uyg6|7edf7edf, debugUnreturnedConnectionStackTraces -> false, description -> null, driverClass -> oracle.jdbc.driver.OracleDriver, factoryClassLocation -> null, forceIgnoreUnresolvedTransactions -> false, identityToken -> 2v242rac4c7k07f7uyg6|7edf7edf, idleConnectionTestPeriod -> 3600, initialPoolSize -> 3, jdbcUrl -> jdbc:oracle:thin:@1*.1*.*.249:1521:HTGCP, maxAdministrativeTaskTime -> 0, maxConnectionAge -> 0, maxIdleTime -> 180, maxIdleTimeExcessConnections -> 0, maxPoolSize -> 20, maxStatements -> 0, maxStatementsPerConnection -> 0, minPoolSize -> 1, numHelperThreads -> 3, numThreadsAwaitingCheckoutDefaultUser -> 0, preferredTestQuery -> null, properties -> {user=******, password=******}, propertyCycle -> 0, testConnectionOnCheckin -> false, testConnectionOnCheckout -> false, unreturnedConnectionTimeout -> 0, usesTraditionalReflectiveProxies -> false ]
[20-8-21 14:11:57:997 CST] 00006644 BasicResource W com.mchange.v2.resourcepool.BasicResourcePool$AcquireTask run com.mchange.v2.resourcepool.BasicResourcePool@27392739 -- Thread unexpectedly interrupted while performing an acquisition attempt.

java.lang.InterruptedException
at java.lang.Thread.sleep(Native Method)
at java.lang.Thread.sleep(Thread.java:851)
at com.mchange.v2.resourcepool.BasicResourcePool$AcquireTask.run(BasicResourcePool.java:1805)
at com.mchange.v2.async.ThreadPoolAsynchronousRunner$PoolThread.run(ThreadPoolAsynchronousRunner.java:547)

[20-8-21 14:11:58:029 CST] 00006645 BasicResource W com.mchange.v2.resourcepool.BasicResourcePool$AcquireTask run com.mchange.v2.resourcepool.BasicResourcePool@27392739 -- Thread unexpectedly interrupted while performing an acquisition attempt.

 java.lang.InterruptedException
at java.lang.Thread.sleep(Native Method)
at java.lang.Thread.sleep(Thread.java:851)
at com.mchange.v2.resourcepool.BasicResourcePool$AcquireTask.run(BasicResourcePool.java:1805)
at com.mchange.v2.async.ThreadPoolAsynchronousRunner$PoolThread.run(ThreadPoolAsynchronousRunner.java:547)

[20-8-21 14:11:59:660 CST] 00006646 BasicResource W com.mchange.v2.resourcepool.BasicResourcePool$AcquireTask run com.mchange.v2.resourcepool.BasicResourcePool@27392739 -- Thread unexpectedly interrupted while performing an acquisition attempt.
                             java.lang.InterruptedException
at java.lang.Thread.sleep(Native Method)
at java.lang.Thread.sleep(Thread.java:851)
at com.mchange.v2.resourcepool.BasicResourcePool$AcquireTask.run(BasicResourcePool.java:1805)
at com.mchange.v2.async.ThreadPoolAsynchronousRunner$PoolThread.run(ThreadPoolAsynchronousRunner.java:547)

[20-8-21 14:12:16:141 CST] 00000ec7 ThreadPoolAsy W com.mchange.v2.async.ThreadPoolAsynchronousRunner$DeadlockDetector run com.mchange.v2.async.ThreadPoolAsynchronousRunner$DeadlockDetector@533c533c -- APPARENT DEADLOCK!!! Creating emergency threads for unassigned pending tasks!

[20-8-21 14:12:16:149 CST] 00000ec7 ThreadPoolAsy W com.mchange.v2.async.ThreadPoolAsynchronousRunner$DeadlockDetector run com.mchange.v2.async.ThreadPoolAsynchronousRunner$DeadlockDetector@533c533c -- APPARENT 
DEADLOCK!!! Complete Status: 
Managed Threads: 3
Active Threads: 3
Active Tasks: 
com.mchange.v2.resourcepool.BasicResourcePool$AcquireTask@6b7c6b7c (com.mchange.v2.async.ThreadPoolAsynchronousRunner$PoolThread-#2)
    com.mchange.v2.resourcepool.BasicResourcePool$AcquireTask@4a884a88 (com.mchange.v2.async.ThreadPoolAsynchronousRunner$PoolThread-#0)
    com.mchange.v2.resourcepool.BasicResourcePool$AcquireTask@411f411f (com.mchange.v2.async.ThreadPoolAsynchronousRunner$PoolThread-#1)
    Pending Tasks: 
    com.mchange.v2.resourcepool.BasicResourcePool$AcquireTask@16501650
    Pool thread stack traces:
Thread[com.mchange.v2.async.ThreadPoolAsynchronousRunner$PoolThread-#2,5,main]
java.net.PlainSocketImpl.socketConnect(Native Method)
    java.net.PlainSocketImpl.doConnect(PlainSocketImpl.java:352)
    java.net.PlainSocketImpl.connectToAddress(PlainSocketImpl.java:214)
    java.net.PlainSocketImpl.connect(PlainSocketImpl.java:194)
    java.net.SocksSocketImpl.connect(SocksSocketImpl.java:378)
    java.net.Socket.connect(Socket.java:537)
    oracle.net.nt.TcpNTAdapter.connect(TcpNTAdapter.java:141)
    oracle.net.nt.ConnOption.connect(ConnOption.java:123)
    oracle.net.nt.ConnStrategy.execute(ConnStrategy.java:337)
    oracle.net.resolver.AddrResolution.resolveAndExecute(AddrResolution.java:422)
    oracle.net.ns.NSProtocol.establishConnection(NSProtocol.java:672)
    oracle.net.ns.NSProtocol.connect(NSProtocol.java:237)
    oracle.jdbc.driver.T4CConnection.connect(T4CConnection.java:1042)
    oracle.jdbc.driver.T4CConnection.logon(T4CConnection.java:301)
    oracle.jdbc.driver.PhysicalConnection.<init>(PhysicalConnection.java:531)
    oracle.jdbc.driver.T4CConnection.<init>(T4CConnection.java:221)
    oracle.jdbc.driver.T4CDriverExtension.getConnection(T4CDriverExtension.java:32)
    oracle.jdbc.driver.OracleDriver.connect(OracleDriver.java:503)
    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:352)
    java.net.PlainSocketImpl.connectToAddress(PlainSocketImpl.java:214)
    java.net.PlainSocketImpl.connect(PlainSocketImpl.java:194)
    java.net.SocksSocketImpl.connect(SocksSocketImpl.java:378)
    java.net.Socket.connect(Socket.java:537)
    oracle.net.nt.TcpNTAdapter.connect(TcpNTAdapter.java:141)
    oracle.net.nt.ConnOption.connect(ConnOption.java:123)
    oracle.net.nt.ConnStrategy.execute(ConnStrategy.java:337)
    oracle.net.resolver.AddrResolution.resolveAndExecute(AddrResolution.java:422)
    oracle.net.ns.NSProtocol.establishConnection(NSProtocol.java:672)
    oracle.net.ns.NSProtocol.connect(NSProtocol.java:237)
    oracle.jdbc.driver.T4CConnection.connect(T4CConnection.java:1042)
    oracle.jdbc.driver.T4CConnection.logon(T4CConnection.java:301)
    oracle.jdbc.driver.PhysicalConnection.<init>(PhysicalConnection.java:531)
    oracle.jdbc.driver.T4CConnection.<init>(T4CConnection.java:221)
    oracle.jdbc.driver.T4CDriverExtension.getConnection(T4CDriverExtension.java:32)
    oracle.jdbc.driver.OracleDriver.connect(OracleDriver.java:503)
    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.PlainSocketImpl.socketConnect(Native Method)
    java.net.PlainSocketImpl.doConnect(PlainSocketImpl.java:352)
    java.net.PlainSocketImpl.connectToAddress(PlainSocketImpl.java:214)
    java.net.PlainSocketImpl.connect(PlainSocketImpl.java:194)
    java.net.SocksSocketImpl.connect(SocksSocketImpl.java:378)
    java.net.Socket.connect(Socket.java:537)
    oracle.net.nt.TcpNTAdapter.connect(TcpNTAdapter.java:141)
    oracle.net.nt.ConnOption.connect(ConnOption.java:123)
    oracle.net.nt.ConnStrategy.execute(ConnStrategy.java:337)
    oracle.net.resolver.AddrResolution.resolveAndExecute(AddrResolution.java:422)
    oracle.net.ns.NSProtocol.establishConnection(NSProtocol.java:672)
    oracle.net.ns.NSProtocol.connect(NSProtocol.java:237)
    oracle.jdbc.driver.T4CConnection.connect(T4CConnection.java:1042)
    oracle.jdbc.driver.T4CConnection.logon(T4CConnection.java:301)
    oracle.jdbc.driver.PhysicalConnection.<init>(PhysicalConnection.java:531)
    oracle.jdbc.driver.T4CConnection.<init>(T4CConnection.java:221)
    oracle.jdbc.driver.T4CDriverExtension.getConnection(T4CDriverExtension.java:32)
    oracle.jdbc.driver.OracleDriver.connect(OracleDriver.java:503)
    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)
    [20-8-21 14:12:16:193 CST] 00000317 ThreadPoolAsy W com.mchange.v2.async.ThreadPoolAsynchronousRunner processReplacedThreads Task com.mchange.v2.resourcepool.BasicResourcePool$AcquireTask@7e477e47 (in deadlocked PoolThread) failed to complete in maximum time 60000ms. Trying interrupt().
    [20-8-21 14:12:16:201 CST] 00000317 ThreadPoolAsy W com.mchange.v2.async.ThreadPoolAsynchronousRunner processReplacedThreads Task com.mchange.v2.resourcepool.BasicResourcePool$AcquireTask@49374937 (in deadlocked PoolThread) failed to complete in maximum time 60000ms. Trying interrupt().
    [20-8-21 14:12:16:210 CST] 00000317 ThreadPoolAsy W com.mchange.v2.async.ThreadPoolAsynchronousRunner processReplacedThreads Task com.mchange.v2.resourcepool.BasicResourcePool$AcquireTask@213e213e (in deadlocked PoolThread) failed to complete in maximum time 60000ms. Trying interrupt().
    [20-8-21 14:12:16:210 CST] 00000317 ThreadPoolAsy W com.mchange.v2.async.ThreadPoolAsynchronousRunner processReplacedThreads Task com.mchange.v2.resourcepool.BasicResourcePool$AcquireTask@213e213e (in deadlocked PoolThread) failed to complete in maximum time 60000ms. Trying interrupt().
[20-8-21 14:12:16:211 CST] 00006647 BasicResource W com.mchange.v2.resourcepool.BasicResourcePool$AcquireTask run com.mchange.v2.resourcepool.BasicResourcePool@7a9a7a9a -- Thread unexpectedly interrupted while performing an acquisition attempt.
java.lang.InterruptedException
at java.lang.Thread.sleep(Native Method)
at java.lang.Thread.sleep(Thread.java:851)
at com.mchange.v2.resourcepool.BasicResourcePool$AcquireTask.run(BasicResourcePool.java:1805)
at com.mchange.v2.async.ThreadPoolAsynchronousRunner$PoolThread.run(ThreadPoolAsynchronousRunner.java:547)
[20-8-21 14:12:17:157 CST] 00006649 BasicResource W com.mchange.v2.resourcepool.BasicResourcePool$AcquireTask run com.mchange.v2.resourcepool.BasicResourcePool$AcquireTask@14581458 -- Acquisition Attempt Failed!!! Clearing pending acquires. While trying to acquire a needed new resource, we failed to succeed more than the maximum number of allowed acquisition attempts (30). Last acquisition attempt exception: 
 java.sql.SQLException: The Network Adapter could not establish the connection
at oracle.jdbc.driver.T4CConnection.logon(T4CConnection.java:412)
at oracle.jdbc.driver.PhysicalConnection.<init>(PhysicalConnection.java:531)
at oracle.jdbc.driver.T4CConnection.<init>(T4CConnection.java:221)
at oracle.jdbc.driver.T4CDriverExtension.getConnection(T4CDriverExtension.java:32)
at oracle.jdbc.driver.OracleDriver.connect(OracleDriver.java:503)
at com.mchange.v2.c3p0.DriverManagerDataSource.getConnection(DriverManagerDataSource.java:134)
at com.mchange.v2.c3p0.WrapperConnectionPoolDataSource.getPooledConnection
(WrapperConnectionPoolDataSource.java:182)
at com.mchange.v2.c3p0.WrapperConnectionPoolDataSource.getPooledConnection(WrapperConnectionPoolDataSource.java:171)
at com.mchange.v2.c3p0.impl.C3P0PooledConnectionPool$1PooledConnectionResourcePoolManager.acquireResource(C3P0PooledConnectionPool.java:137)
at com.mchange.v2.resourcepool.BasicResourcePool.doAcquire(BasicResourcePool.java:1014)
at com.mchange.v2.resourcepool.BasicResourcePool.access$800(BasicResourcePool.java:32)
at com.mchange.v2.resourcepool.BasicResourcePool$AcquireTask.run(BasicResourcePool.java:1810)
at com.mchange.v2.async.ThreadPerTaskAsynchronousRunner$TaskThread.run(ThreadPerTaskAsynchronousRunner.java:255)
Caused by: oracle.net.ns.NetException: The Network Adapter could not establish the connection
at oracle.net.nt.ConnStrategy.execute(ConnStrategy.java:359)
at oracle.net.resolver.AddrResolution.resolveAndExecute(AddrResolution.java:422)
at oracle.net.ns.NSProtocol.establishConnection(NSProtocol.java:672)
at oracle.net.ns.NSProtocol.connect(NSProtocol.java:237)
at oracle.jdbc.driver.T4CConnection.connect(T4CConnection.java:1042)
at oracle.jdbc.driver.T4CConnection.logon(T4CConnection.java:301)
... 12 more
Caused by: java.net.ConnectException: Connection timed out: connect
at java.net.PlainSocketImpl.socketConnect(Native Method)
at java.net.PlainSocketImpl.doConnect(PlainSocketImpl.java:352)
at java.net.PlainSocketImpl.connectToAddress(PlainSocketImpl.java:214)
at java.net.PlainSocketImpl.connect(PlainSocketImpl.java:194)
at java.net.SocksSocketImpl.connect(SocksSocketImpl.java:378)
at java.net.Socket.connect(Socket.java:537)
at oracle.net.nt.TcpNTAdapter.connect(TcpNTAdapter.java:141)
at oracle.net.nt.ConnOption.connect(ConnOption.java:123)
at oracle.net.nt.ConnStrategy.execute(ConnStrategy.java:337)
... 17 more
[20-8-21 14:12:21:198 CST] 0000664a BasicResource W com.mchange.v2.resourcepool.BasicResourcePool$AcquireTask run com.mchange.v2.resourcepool.BasicResourcePool$AcquireTask@1c041c04 -- Acquisition Attempt Failed!!! Clearing pending acquires. While trying to acquire a needed new resource, we failed to succeed more than the maximum number of allowed acquisition attempts (30). Last acquisition attempt exception: 
                             java.sql.SQLException: The Network Adapter could not establish the connection
at oracle.jdbc.driver.T4CConnection.logon(T4CConnection.java:412)
at oracle.jdbc.driver.PhysicalConnection.<init>(PhysicalConnection.java:531)
at oracle.jdbc.driver.T4CConnection.<init>(T4CConnection.java:221)
at oracle.jdbc.driver.T4CDriverExtension.getConnection(T4CDriverExtension.java:32)
at oracle.jdbc.driver.OracleDriver.connect(OracleDriver.java:503)
at com.mchange.v2.c3p0.DriverManagerDataSource.getConnection(DriverManagerDataSource.java:134)
at com.mchange.v2.c3p0.WrapperConnectionPoolDataSource.getPooledConnection(WrapperConnectionPoolDataSource.java:182)
at com.mchange.v2.c3p0.WrapperConnectionPoolDataSource.getPooledConnection(WrapperConnectionPoolDataSource.java:171)
at com.mchange.v2.c3p0.impl.C3P0PooledConnectionPool$1PooledConnectionResourcePoolManager.acquireResource(C3P0PooledConnectionPool.java:137)
at com.mchange.v2.resourcepool.BasicResourcePool.doAcquire(BasicResourcePool.java:1014)
at com.mchange.v2.resourcepool.BasicResourcePool.access$800(BasicResourcePool.java:32)
at com.mchange.v2.resourcepool.BasicResourcePool$AcquireTask.run(BasicResourcePool.java:1810)
at com.mchange.v2.async.ThreadPerTaskAsynchronousRunner$TaskThread.run(ThreadPerTaskAsynchronousRunner.java:255)
Caused by: oracle.net.ns.NetException: The Network Adapter could not establish the connection
at oracle.net.nt.ConnStrategy.execute(ConnStrategy.java:359)
at oracle.net.resolver.AddrResolution.resolveAndExecute(AddrResolution.java:422)
at oracle.net.ns.NSProtocol.establishConnection(NSProtocol.java:672)
at oracle.net.ns.NSProtocol.connect(NSProtocol.java:237)
at oracle.jdbc.driver.T4CConnection.connect(T4CConnection.java:1042)
at oracle.jdbc.driver.T4CConnection.logon(T4CConnection.java:301)
... 12 more
Caused by: java.net.ConnectException: Connection timed out: connect
at java.net.PlainSocketImpl.socketConnect(Native Method)
at java.net.PlainSocketImpl.doConnect(PlainSocketImpl.java:352)
at java.net.PlainSocketImpl.connectToAddress(PlainSocketImpl.java:214)
at java.net.PlainSocketImpl.connect(PlainSocketImpl.java:194)
at java.net.SocksSocketImpl.connect(SocksSocketImpl.java:378)
at java.net.Socket.connect(Socket.java:537)
at oracle.net.nt.TcpNTAdapter.connect(TcpNTAdapter.java:141)
at oracle.net.nt.ConnOption.connect(ConnOption.java:123)
at oracle.net.nt.ConnStrategy.execute(ConnStrategy.java:337)
... 17 more
[20-8-21 14:12:25:311 CST] 0000664b BasicResource W com.mchange.v2.resourcepool.BasicResourcePool$AcquireTask run com.mchange.v2.resourcepool.BasicResourcePool@7a9a7a9a -- Thread unexpectedly interrupted while performing an acquisition attempt.
                             java.lang.InterruptedException
at java.lang.Thread.sleep(Native Method)
at java.lang.Thread.sleep(Thread.java:851)
at com.mchange.v2.resourcepool.BasicResourcePool$AcquireTask.run(BasicResourcePool.java:1805)
at com.mchange.v2.async.ThreadPoolAsynchronousRunner$PoolThread.run(ThreadPoolAsynchronousRunner.java:547)
[20-8-21 14:12:26:425 CST] 0000664c BasicResource W com.mchange.v2.resourcepool.BasicResourcePool$AcquireTask run com.mchange.v2.resourcepool.BasicResourcePool$AcquireTask@2ce32ce3 -- Acquisition Attempt Failed!!! Clearing pending acquires. While trying to acquire a needed new resource, we failed to succeed more than the maximum number of allowed acquisition attempts (30). Last acquisition attempt exception: 
                             java.sql.SQLException: The Network Adapter could not establish the connection
at oracle.jdbc.driver.T4CConnection.logon(T4CConnection.java:412)
at oracle.jdbc.driver.PhysicalConnection.<init>(PhysicalConnection.java:531)
at oracle.jdbc.driver.T4CConnection.<init>(T4CConnection.java:221)
at oracle.jdbc.driver.T4CDriverExtension.getConnection(T4CDriverExtension.java:32)
at oracle.jdbc.driver.OracleDriver.connect(OracleDriver.java:503)
at com.mchange.v2.c3p0.DriverManagerDataSource.getConnection(DriverManagerDataSource.java:134)
at com.mchange.v2.c3p0.WrapperConnectionPoolDataSource.getPooledConnection(WrapperConnectionPoolDataSource.java:182)
at com.mchange.v2.c3p0.WrapperConnectionPoolDataSource.getPooledConnection(WrapperConnectionPoolDataSource.java:171)
at com.mchange.v2.c3p0.impl.C3P0PooledConnectionPool$1PooledConnectionResourcePoolManager.acquireResource(C3P0PooledConnectionPool.java:137)
at com.mchange.v2.resourcepool.BasicResourcePool.doAcquire(BasicResourcePool.java:1014)
at com.mchange.v2.resourcepool.BasicResourcePool.access$800(BasicResourcePool.java:32)
at com.mchange.v2.resourcepool.BasicResourcePool$AcquireTask.run(BasicResourcePool.java:1810)
at com.mchange.v2.async.ThreadPerTaskAsynchronousRunner$TaskThread.run(ThreadPerTaskAsynchronousRunner.java:255)
Caused by: oracle.net.ns.NetException: The Network Adapter could not establish the connection
at oracle.net.nt.ConnStrategy.execute(ConnStrategy.java:359)
at oracle.net.resolver.AddrResolution.resolveAndExecute(AddrResolution.java:422)
at oracle.net.ns.NSProtocol.establishConnection(NSProtocol.java:672)
at oracle.net.ns.NSProtocol.connect(NSProtocol.java:237)
at oracle.jdbc.driver.T4CConnection.connect(T4CConnection.java:1042)
at oracle.jdbc.driver.T4CConnection.logon(T4CConnection.java:301)
... 12 more
Caused by: java.net.ConnectException: Connection timed out: connect
at java.net.PlainSocketImpl.socketConnect(Native Method)
at java.net.PlainSocketImpl.doConnect(PlainSocketImpl.java:352)
at java.net.PlainSocketImpl.connectToAddress(PlainSocketImpl.java:214)
at java.net.PlainSocketImpl.connect(PlainSocketImpl.java:194)
at java.net.SocksSocketImpl.connect(SocksSocketImpl.java:378)
at java.net.Socket.connect(Socket.java:537)
at oracle.net.nt.TcpNTAdapter.connect(TcpNTAdapter.java:141)
at oracle.net.nt.ConnOption.connect(ConnOption.java:123)
at oracle.net.nt.ConnStrategy.execute(ConnStrategy.java:337)
... 17 more
[20-8-21 14:12:34:158 CST] 0000664d BasicResource W com.mchange.v2.resourcepool.BasicResourcePool$AcquireTask run com.mchange.v2.resourcepool.BasicResourcePool@7a9a7a9a -- Thread unexpectedly interrupted while performing an acquisition attempt.
                             java.lang.InterruptedException
at java.lang.Thread.sleep(Native Method)
at java.lang.Thread.sleep(Thread.java:851)
at com.mchange.v2.resourcepool.BasicResourcePool$AcquireTask.run(BasicResourcePool.java:1805)
at com.mchange.v2.async.ThreadPoolAsynchronousRunner$PoolThread.run(ThreadPoolAsynchronousRunner.java:547)
20-8-21 14:12:35:579 CST] 0000002b SystemOut     O NumActive: 0,NumIdle: 4
[20-8-21 14:12:35:698 CST] 0000002b SystemOut     O making a connection...[17698]
[20-8-21 14:12:35:854 CST] 0000002b SystemOut     O Closing connection...[17698]
[20-8-21 14:12:35:854 CST] 0000002b SystemOut     O NumActive: 0,NumIdle: 4
[20-8-21 14:12:35:956 CST] 0000002b SystemOut     O making a connection...[17699]
[20-8-21 14:12:36:291 CST] 0000002b SystemOut     O Closing connection...[17699]


请各位大佬帮帮忙看看,谢谢
  • 写回答

2条回答 默认 最新

  • threenewbee 2020-08-21 17:11
    关注

    线程被中断,比如说主程序提前结束,连接超时等,要找到具体的原因。你可以把代码放在一个单独的小程序里先测试好。

    本回答被题主选为最佳回答 , 对您是否有帮助呢?
    评论
查看更多回答(1条)

报告相同问题?

问题事件

  • 已采纳回答 12月16日

悬赏问题

  • ¥50 MATLAB APP 制作出现问题
  • ¥15 wannier复现图像时berry曲率极值点与高对称点严重偏移
  • ¥15 利用决策森林为什么会出现这样·的问题(关键词-情感分析)
  • ¥15 DispatcherServlet.noHandlerFound No mapping found for HTTP request with URI[/untitled30_war_e
  • ¥15 使用deepspeed训练,发现想要训练的参数没有梯度
  • ¥15 寻找一块做为智能割草机的驱动板(标签-stm32|关键词-m3)
  • ¥15 信息管理系统的查找和排序
  • ¥15 基于STM32,电机驱动模块为L298N,四路运放电磁传感器,三轮智能小车电磁组电磁循迹(两个电机,一个万向轮),怎么用读取的电磁传感器信号表示小车所在的位置
  • ¥15 如何解决y_true和y_predict数据类型不匹配的问题(相关搜索:机器学习)
  • ¥15 PB中矩阵文本型数据的总计问题。