commons-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From p...@shareowner.com
Subject RE: DBCP: java.sql.SQLException: Cannot load JDBC driver class 'n ull'
Date Mon, 06 Jan 2003 16:06:13 GMT
Place your classes12.jar in tomcat's common/lib

Regards,
 
 
PQ
 
"This Guy Thinks He Knows Everything"
"This Guy Thinks He Knows What He Is Doing"

-----Original Message-----
From: David Hemingway [mailto:dbh001@kooee.com.au] 
Sent: January 5, 2003 11:51 PM
To: commons-user@jakarta.apache.org
Subject: DBCP: java.sql.SQLException: Cannot load JDBC driver class 'null'

Hi,

Sorry if this has been addressed before on this list but I have not seen it.
I have followed the instructions in
http://jakarta.apache.org/tomcat/tomcat-4.1-doc/jndi-datasource-examples-how
to.html. I am not sure if this is a problem with tomcat or with dbcp.

I can get the setup to work 100% under win32 but using the same settings
under linux I get: 

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
12)

I have seen this problem raised in many places but no one has seemed to know
the correct answer.

My configuration is as follows:

Linux - Red Hat 7.3
Apache 1.3.27
Tomcat 4.1.12 LE
Oracle 9i
Pool 1.0
DBCP 1.0
Collections 2.0

common/lib/commons-collections.jar
common/lib/commons-dbcp.jar
common/lib/commons-pool.jar
common/lib/classes12.jar (with the javax.sql removed)

server.xml:


<Context path="/lawonline" docBase="lawonline" debug="0"
                 reloadable="true" crossContext="true">
          <Logger className="org.apache.catalina.logger.FileLogger"
                     prefix="localhost_lawonline_log." suffix=".txt"
                  timestamp="true"/>
          <Ejb   name="ejb/EmplRecord" type="Entity"
                 home="com.wombat.empl.EmployeeRecordHome"
               remote="com.wombat.empl.EmployeeRecord"/>

 <Resource name="jdbc/myoracle" auth="Container"
              type="javax.sql.DataSource"/>

 <ResourceParams name="jdbc/myoracle">
   <parameter>
     <name>factory</name>
     <value>org.apache.commons.dbcp.BasicDataSourceFactory</value>
   </parameter>
   <parameter>
     <name>driverClassName</name>
     <value>oracle.jdbc.driver.OracleDriver</value>
   </parameter>
   <parameter>
     <name>url</name>
     <value>jdbc:oracle:thin:@192.168.0.10:1521:lawol</value>
   </parameter>
   <parameter>
     <name>username</name>
     <value>lawonline</value>
   </parameter>
   <parameter>
     <name>password</name>
     <value>Le12No06</value>
   </parameter>
   <parameter>
     <name>maxActive</name>
     <value>10</value>
   </parameter>
   <parameter>
     <name>maxIdle</name>
     <value>10</value>
   </parameter>
   <parameter>
     <name>maxWait</name>
     <value>-1</value>
   </parameter>
 </ResourceParams>

       <Environment name="maxExemptions" type="java.lang.Integer"
                      value="15"/>
          <Parameter name="context.param.name" value="context.param.value"
                     override="false"/>
          <Resource name="jdbc/EmployeeAppDb" auth="SERVLET"
                    type="javax.sql.DataSource"/>
          <ResourceParams name="jdbc/EmployeeAppDb">
            <parameter><name>username</name><value>sa</value></parameter>
            <parameter><name>password</name><value></value></parameter>
            <parameter><name>driverClassName</name>
              <value>org.hsql.jdbcDriver</value></parameter>
            <parameter><name>url</name>
              <value>jdbc:HypersonicSQL:database</value></parameter>
          </ResourceParams>
          <Resource name="mail/Session" auth="Container"
                    type="javax.mail.Session"/>
          <ResourceParams name="mail/Session">
            <parameter>
              <name>mail.smtp.host</name>
              <value>localhost</value>
            </parameter>
          </ResourceParams>
          <ResourceLink name="linkToGlobalResource"
                    global="simpleValue"
                    type="java.lang.Integer"/>
</Context>


web.xml:

<resource-ref>
  <description>DB Connection</description>
  <res-ref-name>jdbc/myoracle</res-ref-name>
  <res-type>javax.sql.DataSource</res-type>
  <res-auth>Container</res-auth>
</resource-ref>


Any help would be very much appreciated. Thank you

regards,
David Hemingway



Mime
  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message