tomcat-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Martin Jacobson <>
Subject Re: Connection pooling doesn't work for me ... Help !!
Date Wed, 19 Jun 2002 09:47:19 GMT wrote:

> Hi,
> did anyone of you get any furter?
> thanks anthony 
>>    I've posted a solution see "Generic DataSource Resource Factory
>>Available. JDBC Data Source" 
> and Les Hughes 
> for your tutorials. I still could not succeed.
> Did anyone try to figure out why we do not get a DB-Connection?
> I do not find a point to start form with debugging.
> Rainer


I am in a similar position :-(

If anybody can shed some light on the reasons why it won't work, I'd 
also be VERY grateful!

My set-up:
Mac OS X 10.1.5 - JDK 1.3.1 update 1
DB - mySQL 3.23.49 - mm.MySQL 2.0.14
Tomcat Standalone on ports 80/443 - 4.1.3
Velocity 1.2

Here is relevant part of <server.xml>...

<Resource name="jdbc/RadiationDB"
<Resource-params name="jdbc/RadiationDB">

Here is the part of <web.xml> where it is referenced...

     Refers to the jdbc connection pool for this app


And here is the code that I use to obtain a Connection...

Connection conn=null;
   javax.naming.Context nctx = new javax.naming.InitialContext();
   if (nctx == null)
     throw new Exception("No Context!");
   DataSource ds = 
   if (ds == null)
     throw new Exception("No Datasource Found!");
     conn = ds.getConnection();
     if (conn == null)
       throw new Exception("Cant get Connection from DataSource!");
catch (Exception e)
   log("Error! ", e);


And here is what I find in the log...

2002-06-19 10:58:28 NamingContextListener[/Standalone/localhost/drs]: 
Creating JNDI naming context
2002-06-19 10:58:28 NamingContextListener[/Standalone/localhost/drs]: 
Resource parameters for jdbc/RadiationDB = null
2002-06-19 10:58:28 NamingContextListener[/Standalone/localhost/drs]: 
Adding resource ref jdbc/RadiationDB
2002-06-19 10:58:28 NamingContextListener[/Standalone/localhost/drs]: 
2002-06-19 10:58:28 NamingContextListener[/Standalone/localhost/drs]: 
Resource parameters for UserTransaction = null
<snip irrelevant stuff>
2002-06-19 11:00:21 static: Error!
java.sql.SQLException: Cannot load JDBC driver class 'null'
	at org.apache.commons.dbcp.BasicDataSource.createDataSource(Unknown Source)
	at org.apache.commons.dbcp.BasicDataSource.getConnection(Unknown Source)
	at com.terma.martin.drs.StaticPage.handleRequest(Unknown Source)
	at <etc. etc.>

Looking carefully at the logs, it seems that the Resource-params are not 
being processed, so that createDataSource() doesn't know what JDBC 
driver to use. But as far as I can tell, the parameters are all 
correctly specified, so what's going on?

This is beginning to SERIOUSLY p*ss me off!


To unsubscribe, e-mail:   <>
For additional commands, e-mail: <>

View raw message