Acquisition Attempt Failed!!! Clearing pending acquires. While trying to acquire a needed new resou

博客内容讲述了在尝试连接数据库时遇到的问题,经过一系列排查,包括检查链接信息、代码配置、网络状况以及更换驱动,最终发现是由于数据库主机地址不正确导致的 Acquisition Attempt Failed 异常。

摘要生成于 C知道 ,由 DeepSeek-R1 满血版支持, 前往体验 >

警告: com.mchange.v2.resourcepool.BasicResourcePool$AcquireTask@8b3bdd -- 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.lang.NullPointerException  

找了好久很多资料,

尝试检查 链接地址用户名密码正确性及大小写驱动,尝试检查代码内部是否配置出错,在进行ping数据库所在主机及测试网络通畅,可以登录plsql后,


查询驱动并且尝试更换驱动jar包无果之后公司大神发现

这个异常的原因是:队友提供的数据库主机地址不对!!!!!!!!



其他正常遇到的问题可以参考以下资料:

参考资料地址:https://yq.aliyun.com/wenzhang/show_149232

http://blog.youkuaiyun.com/piggachen/article/details/69943264

http://blog.youkuaiyun.com/xyw591238/article/details/51583996

完整异常:

WARN [com.mchange.v2.resourcepool.BasicResourcePool] - com.mchange.v2.resourcepool.BasicResourcePool$AcquireTask@7080e376 -- 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: Io 异常: The Network Adapter could not establish the connection
	at oracle.jdbc.driver.DatabaseError.throwSqlException(DatabaseError.java:111)
	at oracle.jdbc.driver.DatabaseError.throwSqlException(DatabaseError.java:145)
	at oracle.jdbc.driver.DatabaseError.throwSqlException(DatabaseError.java:254)
	at oracle.jdbc.driver.T4CConnection.logon(T4CConnection.java:386)
	at oracle.jdbc.driver.PhysicalConnection.<init>(PhysicalConnection.java:413)
	at oracle.jdbc.driver.T4CConnection.<init>(T4CConnection.java:164)
	at oracle.jdbc.driver.T4CDriverExtension.getConnection(T4CDriverExtension.java:34)
	at oracle.jdbc.driver.OracleDriver.connect(OracleDriver.java:752)
	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.ThreadPoolAsynchronousRunner$PoolThread.run(ThreadPoolAsynchronousRunner.java:547)

评论 4
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值