aspose file tools*
The moose likes JDBC 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 Spring in Action this week in the Spring forum!
JavaRanch » Java Forums » Databases » JDBC
Bookmark "AbandonedObjectPool failed on borrowObject: null" Watch "AbandonedObjectPool failed on borrowObject: null" New topic
Author

AbandonedObjectPool failed on borrowObject: null

JW Li
Ranch Hand

Joined: Mar 11, 2003
Posts: 33
Hi,

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
java.lang.NullPointerException
at org.apache.commons.dbcp.DelegatingConnection.setAutoCommit(DelegatingConnection.java:237)
at org.apache.commons.dbcp.PoolableConnectionFactory.activateObject(PoolableConnectionFactory.java:273)
at org.apache.commons.pool.impl.GenericObjectPool.borrowObject(Unknown Source)
at org.apache.commons.dbcp.AbandonedObjectPool.borrowObject(AbandonedObjectPool.java:117)
at org.apache.commons.dbcp.PoolingDataSource.getConnection(PoolingDataSource.java:110)
at org.apache.commons.dbcp.BasicDataSource.getConnection(BasicDataSource.java:312)

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: http://aspose.com/file-tools
 
subject: AbandonedObjectPool failed on borrowObject: null