tomcat-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Saurabh Nanda" <saurabhna...@gmail.com>
Subject Database connection pooling errors in Tomcat 5.5.17
Date Tue, 17 Oct 2006 10:33:31 GMT
Hi,

I'm trying to configure a pooled database connection in Tomcat 5.5.17
but getting a strange error which looks like this:

java.lang.NullPointerException	
org.apache.tomcat.dbcp.dbcp.DelegatingConnection.close(DelegatingConnection.java:151)
org.apache.tomcat.dbcp.dbcp.PoolableConnection.reallyClose(PoolableConnection.java:95)
org.apache.tomcat.dbcp.dbcp.PoolableConnectionFactory.destroyObject(PoolableConnectionFactory.java:301)
org.apache.tomcat.dbcp.dbcp.BasicDataSource.validateConnectionFactory(BasicDataSource.java:883)
org.apache.tomcat.dbcp.dbcp.BasicDataSource.createDataSource(BasicDataSource.java:851)
org.apache.tomcat.dbcp.dbcp.BasicDataSource.getConnection(BasicDataSource.java:540)
testConf.TestConfServlet.doGet(TestConfServlet.java:37)
.... and so on

*** The META-INF/context.xml file has the following entry: ****
<Resource name="jdbc/myoracle"
	auth="Container"
	type="javax.sql.DataSource"
	driverClassName="oracle.jdbc.driver.OracleDriver"
	url="jdbc:oracle:thin:eps@192.168.0.253:1521:temp"
	username="temp"
	password="temp"
	maxActive="0"
	maxIdle="5"
	maxWait="10000"
	removeAbandoned="true"
	removeAbandonedTimeout="120"
	logAbandoned="true"
/>


*** Here's some sample code and output WITHOUT ERRORS: ****
Context ctx=new InitialContext();
NamingEnumeration list=ctx.list("java:/comp/env/jdbc");
out.write("<HTML><pre>");
NameClassPair pair;
while(list.hasMore()) {
	pair=(NameClassPair) list.nextElement();
	out.write(pair.getName() + "=" + pair.getClassName() + "\n");
}
DataSource ds=(DataSource) ctx.lookup("java:/comp/env/jdbc/myoracle");
out.write("ds=" + ds.toString() + "\n");

*** OUTPUT OF THE ABOVE CODE ****
myoracle=org.apache.tomcat.dbcp.dbcp.BasicDataSource
ds=org.apache.tomcat.dbcp.dbcp.BasicDataSource@1cb52ae

*** But as soon as I try to obtain a connection I start getting the
error I mentioned above!

I've spent a lot of time on this -- could someone please tell me where
I'm going wrong!

TIA
Nandz.
-- 
http://nandz.blogspot.com
http://foodieforlife.blogspot.com

---------------------------------------------------------------------
To start a new topic, e-mail: users@tomcat.apache.org
To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
For additional commands, e-mail: users-help@tomcat.apache.org


Mime
View raw message