You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@tomcat.apache.org by "Robert K. Vanderhoek" <ro...@nhdeeds.com> on 2009/03/11 19:02:11 UTC

Tomcat 6 and Apache Derby

 I'm having some trouble getting Apache Derby embedded inside Tomcat 6 so I can access a database threw my webapp.  I am receiving the following error in the catalina.out log file: /Class Not Found: java.lang.ClassNotFoundException: jdbc:derby/.  This is generated in the log when the webapp is accessed.  I have set the classpath locally with derbys setEmbeddedCP command.  I am thinking I also have to specify the classpath in Tomcat too.  Is this done by modifying the server.xml globally or the web.xml for each webapp?  When I look online for help, most of what I'm finding says all you have to do is copy the derby.jar to $CATALINA_HOME/lib and tomcat will automatically load any jar files it finds, is that true?  Any help or feedback on this will be much appreciated, thank you.

Software running on server
- RHEL4u3
- Java6u7
- Tomcat6.0
- Derby 10.4.2.0

Directory structure
- /usr/apache-tomcat-6.0.18 (CATALINA_HOME)
- /usr/apache-tomcat-6.0.18/lib/derby.jar (copied in from DERBY_HOME/lib, figuring tomcat would automatically load it on startup for each webapp)
- /usr/java/jdk1.6.0_07 (JAVA_HOME)
- /usr/db-derby-10.4.2.0-bin (DERBY_HOME)

Robert


RE: Tomcat 6 and Apache Derby

Posted by "Caldarale, Charles R" <Ch...@unisys.com>.
> From: Robert K. Vanderhoek [mailto:rob727@nhdeeds.com] 
> Subject: Tomcat 6 and Apache Derby
> 
> /Class Not Found: java.lang.ClassNotFoundException: 
> jdbc:derby/.  

Looks like either your code to create a DB connection is incorrect, or your <Resource> config is bad.

> I have set the classpath locally with derbys 
> setEmbeddedCP command.

A Bad Idea.

> I am thinking I also have to specify 
> the classpath in Tomcat too.

A Really Bad Idea.

Sounds like you need to read the documentation:
http://tomcat.apache.org/tomcat-6.0-doc/jndi-datasource-examples-howto.html

 - Chuck


THIS COMMUNICATION MAY CONTAIN CONFIDENTIAL AND/OR OTHERWISE PROPRIETARY MATERIAL and is thus for use only by the intended recipient. If you received this in error, please contact the sender and delete the e-mail and its attachments from all computers.

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
For additional commands, e-mail: users-help@tomcat.apache.org