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:[EMAIL PROTECTED]: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
[EMAIL PROTECTED]

*** 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: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to