tomcat-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Kevin HaleBoyes <kcbo...@yahoo.com>
Subject (application library) ClassNotFoundException
Date Mon, 09 Jul 2001 17:55:47 GMT
I've been running Tomcat 4.0b5 since it was released and had the JDBCRealm
stuff working just fine.  I've been using Oracle 8.1.7 (8i) on Linux RedHat
6.2.  I upgraded just recently to RedHat 7.1 and Oracle 9i (9.0.1) and tried
to get my application working again but it is failing on the JDBCRealm
initialization.  Specifically, the first call to open() fails with a
ClassNotFoundException for the oracle JDBC driver.  The relavent part of the
server.xml file is

   <Realm  className="org.apache.catalina.realm.JDBCRealm" debug="99"
           driverName="oracle.jdbc.OracleDriver"
           connectionURL="jdbc:oracle:thin:@castor:1521:orasid9i"
           connectionName="opf" connectionPassword="opf"
           userTable="opf_user_cred" userNameCol="user_name"
           userCredCol="password"
           userRoleTable="opf_user_roles" roleNameCol="role_name"
           digest="MD5"
           />

The only change I made for 9i was to change the driverName from
oracle.jdbc.driver.OracleDriver to oracle.jdbc.OracleDriver as recommended
by Oracle.  In my application lib directory I made a link to the classes12.zip
(and .jar file) and rebuilt.  I've confirmed that the classes12.{jar,zip}
files are in
/usr/local/jakarta/jakarta-tomcat-4.0-b5/src/build/webapps/opf/WEB-INF/lib/
directory and tried to start Tomcat.:

I get the following message

Starting service Tomcat-Standalone
Apache Tomcat/4.0-b5
Catalina.start: LifecycleException:  Exception opening database connection: 
java.sql.SQLException: oracle.jdbc.OracleDriver
LifecycleException:  Exception opening database connection: 
java.sql.SQLException: oracle.jdbc.OracleDriver
	at org.apache.catalina.realm.JDBCRealm.start(JDBCRealm.java:621)
	at org.apache.catalina.core.ContainerBase.start(ContainerBase.java:1108)
	at org.apache.catalina.core.StandardEngine.start(StandardEngine.java:278)
	at org.apache.catalina.core.StandardService.start(StandardService.java:353)
	at org.apache.catalina.core.StandardServer.start(StandardServer.java:458)
	at org.apache.catalina.startup.Catalina.start(Catalina.java:725)
	at org.apache.catalina.startup.Catalina.execute(Catalina.java:647)
	at org.apache.catalina.startup.Catalina.process(Catalina.java:177)
	at java.lang.reflect.Method.invoke(Native Method)
	at org.apache.catalina.startup.Bootstrap.main(Bootstrap.java:196)
----- Root Cause -----
java.sql.SQLException: oracle.jdbc.OracleDriver
	at org.apache.catalina.realm.JDBCRealm.open(JDBCRealm.java:534)
	at org.apache.catalina.realm.JDBCRealm.start(JDBCRealm.java:619)
	at org.apache.catalina.core.ContainerBase.start(ContainerBase.java:1108)
	at org.apache.catalina.core.StandardEngine.start(StandardEngine.java:278)
	at org.apache.catalina.core.StandardService.start(StandardService.java:353)
	at org.apache.catalina.core.StandardServer.start(StandardServer.java:458)
	at org.apache.catalina.startup.Catalina.start(Catalina.java:725)
	at org.apache.catalina.startup.Catalina.execute(Catalina.java:647)
	at org.apache.catalina.startup.Catalina.process(Catalina.java:177)
	at java.lang.reflect.Method.invoke(Native Method)
	at org.apache.catalina.startup.Bootstrap.main(Bootstrap.java:196)

You'll notice something odd about the message.  It doesn't say what the
exception actually was!!!
So, I edited JDBCRealm.java and put in a few
log() calls to get the following:

2001-07-09 13:47:17 JDBCRealm[Standalone]: open():- opening a DB connection
2001-07-09 13:47:17 JDBCRealm[Standalone]: open():- instantiating a new driver:
name=oracle.jdbc.OracleDriver, instance=null
2001-07-09 13:47:17 JDBCRealm[Standalone]: open():- instantiation exception:
java.lang.ClassNotFoundException: oracle.jdbc.OracleDriver
	at
org.apache.catalina.loader.StandardClassLoader.loadClass(StandardClassLoader.java:1111)
	at
org.apache.catalina.loader.StandardClassLoader.loadClass(StandardClassLoader.java:976)
	at java.lang.ClassLoader.loadClassInternal(ClassLoader.java:313)
	at java.lang.Class.forName0(Native Method)
	at java.lang.Class.forName(Class.java:120)
	at org.apache.catalina.realm.JDBCRealm.open(JDBCRealm.java:529)
	at org.apache.catalina.realm.JDBCRealm.start(JDBCRealm.java:619)
	at org.apache.catalina.core.ContainerBase.start(ContainerBase.java:1108)
	at org.apache.catalina.core.StandardEngine.start(StandardEngine.java:278)
	at org.apache.catalina.core.StandardService.start(StandardService.java:353)
	at org.apache.catalina.core.StandardServer.start(StandardServer.java:458)
	at org.apache.catalina.startup.Catalina.start(Catalina.java:725)
	at org.apache.catalina.startup.Catalina.execute(Catalina.java:647)
	at org.apache.catalina.startup.Catalina.process(Catalina.java:177)
	at java.lang.reflect.Method.invoke(Native Method)
	at org.apache.catalina.startup.Bootstrap.main(Bootstrap.java:196)

There we go - the ClassNotFoundException message.
I'd love to know why Tomcat can't find the OracleDriver class.
Just to be sure, I compiled and ran the Employee.java sample shipped with
Oracle against the webapps/opf/WEB-INF/lib/classes12.jar file and it worked
fine and it uses the oracle.jdbc.OracleDriver class.

Any help would be appreciated.
Thanks,
Kevin.


____________________________________________________________
Do You Yahoo!?
Get your free @yahoo.co.uk address at http://mail.yahoo.co.uk
or your free @yahoo.ie address at http://mail.yahoo.ie

Mime
View raw message