On Tue, 2004-04-13 at 13:35, Parsons Technical Services wrote: > Paul, > > Several questions: > > What version of Tomcat is this?
Version 5 from what I can tell from the licence agreement. (What is the correct way to determine?) > What platform/OS are you on? Solaris 9 (MU3 applied) on Sparc > Which JDK version? Sun J2SDK build 1.4.2-b28 > > Typically this error is from a mis-configuration for the jndi. > > Here are my configuration files or parts of for my development box. > > First in the server.xml set up a GlobalResource such as this: > > Of course replace the necesary data with your specifics. > [snip] I have this. > Next place this, at the bottom, in your web.xml for the app: > [snip] I have this also.. Both of these I have copied almost verbatim from the Tomcat JNDI DataSource HowTo. I can paste you in my exact code if you think it would help. > For TC5: Now create a file in the META-INF directory. Name the file > context.xml. > In this file you will need to define the context and the link to the jdbc. > For TC4: Add this to the server.xml > [snip] I have tried with and without the context.xml, it didn't make any difference. I do not think that the JNDI binding is the real problem as when I change the calling code in my Servlet to look up the wrong JNDI name I get different errors. I think that the binding is there but it is somehow not getting the correct parameters. In particular the driver class name. > ----- Original Message ----- > From: "Paul Richards" <[EMAIL PROTECTED]> > To: <[EMAIL PROTECTED]> > Sent: Tuesday, April 13, 2004 3:03 PM > Subject: Tomcat and DataSource JNDI > > > > Hi, > > I am running Tomcat from the Java Webservices Developer Pack 1.3 and I > > cannot get JNDI working for mysql DataSource objects. I have googled > > around for my error which is: > > > > java.sql.SQLException: Cannot load JDBC driver class 'null' > > at > org.apache.commons.dbcp.BasicDataSource.createDataSource(BasicDataSource.jav > a:529) > > at > org.apache.commons.dbcp.BasicDataSource.getConnection(BasicDataSource.java:3 > 29) > > > > > > What I found on google was that this error is not just a problem with > Mysql and that people have experienced it with Oracle and Postgresql also: > > > http://archives.real-time.com/pipermail/tomcat-users/2002-October/081368.html > > > > I tried the suggestion in this last URL of using the exact orderings of > > parameters in the server.xml file as shown in the Tomcat JNDI DataSource > > HowTo. Unfortunately this has not helped my case. > > > > > > I appreciate that a very similar thread to this is currently running but > > that problem looks different to mine. > > > > > > I have failover code which created a Mysql datasource manually if the > > JNDI fails and the failover code works perfectly. This makes me sure > > that my CLASSPATHs are correct. > > > > > > > > -- > > Paul Richards <[EMAIL PROTECTED]> > > > > > > --------------------------------------------------------------------- > > To unsubscribe, e-mail: [EMAIL PROTECTED] > > For additional commands, e-mail: [EMAIL PROTECTED] > > > > > > > > --------------------------------------------------------------------- > To unsubscribe, e-mail: [EMAIL PROTECTED] > For additional commands, e-mail: [EMAIL PROTECTED] -- Paul Richards <[EMAIL PROTECTED]> --------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]