tomcat-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Ben Anderson" <stuts_anderson...@hotmail.com>
Subject RE: Cannot load JDBC driver class 'null'
Date Thu, 11 Sep 2003 16:41:54 GMT
I moved the <Resource> and <ResaourceParams> tags to myApp.xml and put it in 
the webapps folder(with the war).  I'm still getting the exact same errors.


>From: Phillip Qin <Phillip.Qin@shareowner.com>
>Reply-To: "Tomcat Users List" <tomcat-user@jakarta.apache.org>
>To: 'Tomcat Users List' <tomcat-user@jakarta.apache.org>
>Subject: RE: Cannot load JDBC driver class 'null'
>Date: Thu, 11 Sep 2003 10:32:47 -0400
>
>My advice:
>
>1. Never put jdbc in your classpath. It is in
>$CATALINA_HOME/common/lib/classes12.jar. Tomcat classloader handles it.
>2. If you want to do a compile, use ant and put it in your ant script.
>
>Below is my setup
>
><Context path="/myapp" docBase="myapp"
>         debug="5" reloadable="true" crossContext="false">
>
>	<Logger className="org.apache.catalina.logger.FileLogger"
>			prefix="myapp_log." suffix=".txt"
>			timestamp="true"/>
>
>	<Resource name="jdbc/myapp" auth="Container"
>type="javax.sql.DataSource"/>
>	<ResourceParams name="jdbc/myapp">
>	<parameter>
>		<name>driverClassName</name>
>		<value>oracle.jdbc.driver.OracleDriver</value>
>	</parameter>
>	<parameter>
>		<name>url</name>
>	<value>jdbc:oracle:thin:@myoracleserver.com:1521:PROD</value>
>	</parameter>
>	<parameter>
>		<name>username</name>
>		<value>***</value>
>	</parameter>
>	<parameter>
>		<name>password</name>
>		<value>***</value>
>	</parameter>
>	<parameter>
>		<name>maxActive</name>
>		<value>20</value>
>	</parameter>
>	<parameter>
>		<name>maxIdle</name>
>		<value>10</value>
>	</parameter>
>	<parameter>
>		<name>minIdle</name>
>		<value>10</value>
>	</parameter>
>	<parameter>
>		<name>maxWait</name>
>		<value>15000</value>
>	</parameter>
>	<parameter>
>		<name>removeAbandoned</name>
>		<value>true</value>
>	</parameter>
>	<parameter>
>		<name>logAbandoned</name>
>		<value>true</value>
>	</parameter>
>	<parameter>
>		<name>validationQuery</name>
>		<value>SELECT SYSDATE FROM DUAL</value>
>	</parameter>
>	<parameter>
>		<name>testOnBorrow</name>
>		<value>true</value>
>	</parameter>
>	<parameter>
>		<name>minEvictableIdleTimeMillis</name>
>		<value>-1</value>
>	</parameter>
>	<!-- sleeps 5 minutes -->
>	<parameter>
>		<name>timeBetweenEvictionRunsMillis</name>
>		<value>300000</value>
>	</parameter>
>	<parameter>
>		<name>numTestsPerEvictionRun</name>
>		<value>1</value>
>	</parameter>
>	<parameter>
>		<name>testWhileIdle</name>
>		<value>true</value>
>	</parameter>
>
>	</ResourceParams>
></Context>
>
>In web.xml:
>
><resource-ref>
>	<description>Oracle Datasource</description>
>	<res-ref-name>jdbc/myapp</res-ref-name>
>	<res-type>javax.sql.DataSource</res-type>
>	<res-auth>Container</res-auth>
></resource-ref>
>
>-----Original Message-----
>From: Ben Anderson [mailto:stuts_andersonbd1@hotmail.com]
>Sent: September 11, 2003 8:17 AM
>To: tomcat-user@jakarta.apache.org
>Subject: Cannot load JDBC driver class 'null'
>
>Ok, I know this topic has been posted many times, but I can't find anything
>to help.
>
>I have OracleDriver in [$CATALINA_HOME]/common/lib
>here's my server.xml
><GlobalNamingResources>
>......................
><Resource name="myDS" scope="Shareable" type="javax.sql.DataSource"
>auth="Container"/>
>     <ResourceParams name="myDS">
>       <parameter>
>         <name>validationQuery</name>
>         <value>select user from dual;</value>
>       </parameter>
>       <parameter>
>         <name>url</name>
>         <value>jdbc:oracle:thin:myMachine:1521:myDBName</value>
>       </parameter>
>       <parameter>
>         <name>username</name>
>         <value>hris</value>
>       </parameter>
>       <parameter>
>         <name>password</name>
>         <value>****</value>
>       </parameter>
>       <parameter>
>         <name>maxActive</name>
>         <value>4</value>
>       </parameter>
>       <parameter>
>         <name>maxWait</name>
>         <value>5000</value>
>       </parameter>
>       <parameter>
>         <name>driverClassName</name>
>         <value>oracle.jdbc.driver.OracleDriver</value>
>       </parameter>
>       <parameter>
>         <name>maxIdle</name>
>         <value>2</value>
>       </parameter>
>     </ResourceParams>
>   </GlobalNamingResources>
>
>and my web.xml:
>
>     <resource-ref>
>         <res-ref-name>jdbc/fsaDS</res-ref-name>
>         <res-type>javax.sql.DataSource</res-type>
>         <res-auth>Container</res-auth>
>         <res-sharing-scope>Shareable</res-sharing-scope>
>     </resource-ref>
>
>in the administrative tool:
>the top level Resources->DataSources looks ok as MyDS is listed there
>but the /my_context->Resources->Datasources gives:
>org.apache.jasper.JasperException: Exception retrieving attribute
>'driverClassName'
>
>and the localhost_log.xxx.txt (when it tries to use myDS):
>java.sql.SQLException: Cannot load JDBC driver class 'null
>
>Any help would be great - I've been trying everything - reloading with
>different configurations about 50 times - looking through books, mailing
>lists/archives.
>Thanks,
>Ben
>
>_________________________________________________________________
>Get 10MB of e-mail storage! Sign up for Hotmail Extra Storage.
>http://join.msn.com/?PAGE=features/es
>
>
>---------------------------------------------------------------------
>To unsubscribe, e-mail: tomcat-user-unsubscribe@jakarta.apache.org
>For additional commands, e-mail: tomcat-user-help@jakarta.apache.org

_________________________________________________________________
Use custom emotions -- try MSN Messenger 6.0! 
http://www.msnmessenger-download.com/tracking/reach_emoticon


Mime
View raw message