This week's giveaway is in the Spring forum.
We're giving away four copies of REST with Spring (video course) and have Eugen Paraschiv on-line!
See this thread for details.
The moose likes JDBC and Relational Databases and the fly likes AbandonedObjectPool failed on borrowObject: null Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login

Win a copy of REST with Spring (video course) this week in the Spring forum!
JavaRanch » Java Forums » Databases » JDBC and Relational Databases
Bookmark "AbandonedObjectPool failed on borrowObject: null" Watch "AbandonedObjectPool failed on borrowObject: null" New topic

AbandonedObjectPool failed on borrowObject: null

Ranch Hand

Joined: Mar 11, 2003
Posts: 33

Can anyone help me on this one? I've been struggled long to configure Tomcat for database pooling (to Oracle) using DBCP... And finally this is the error I got:

DBCP borrowObject failed: null
at org.apache.commons.dbcp.DelegatingConnection.setAutoCommit(
at org.apache.commons.dbcp.PoolableConnectionFactory.activateObject(
at org.apache.commons.pool.impl.GenericObjectPool.borrowObject(Unknown Source)
at org.apache.commons.dbcp.AbandonedObjectPool.borrowObject(
at org.apache.commons.dbcp.PoolingDataSource.getConnection(
at org.apache.commons.dbcp.BasicDataSource.getConnection(

Here's the code of how I got the DataSource and Connection:

Context initContext = new InitialContext();
Context envContext = (Context)initContext.lookup("java:comp/env");
DataSource dbSource = (DataSource) envContext.lookup("jdbc/oracle");
Connection con = dbSource.getConnection();

Tomcat did get the datasource back, but failed at the get connection line. What's wrong? I followed the instructions on Apache website on how to configure Database pool using DBCP... I tried to follow the example code in DBCP website to manually configure the database pool and it succeeded without any problem. So my system setup shouldn't have any problem... Can any one give me any idea of what's wrong here? Any feedback is highly appreaciated! I really want to know why Tomcat can not initialze the Database pool successfully!
I agree. Here's the link:
subject: AbandonedObjectPool failed on borrowObject: null
It's not a secret anymore!