It's not a secret anymore!*
The moose likes Mac OS and the fly likes Mac OS X Tomcat classpath issues Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Murach's Java Servlets and JSP this week in the Servlets forum!
JavaRanch » Java Forums » Engineering » Mac OS
Bookmark "Mac OS X Tomcat classpath issues" Watch "Mac OS X Tomcat classpath issues" New topic
Author

Mac OS X Tomcat classpath issues

Ramesh Manian
Greenhorn

Joined: Nov 10, 2009
Posts: 2
I am running Tomcat 5.5 on my Mac OS X (snow leopard) with MySql 5.0 and I keep getting an error "No suitable JDBC driver found" when I run my app. My Java class which does indeed use MySql works perfectly fine when I run it from my Eclipse dev environment and gives me an error when Tomcat starts up (that starts my java class).

I think it has to do with classpath issue. I do not have an issue when I runt his from my Windows environment.

What could be causing this discrepancy? Any help is greatly appreciated. Thanks
Ulf Dittmer
Marshal

Joined: Mar 22, 2005
Posts: 41079
    
  43
Welcome to JavaRanch.

How are you adding the driver jar file to the classpath so that Tomcat can find it? If you put it in TOMCAT_HOME/common/lib then all web apps (and Tomcat itself) can use it. If you want a single web app to use it, put it into that web app's WEB-INF/lib directory.


Ping & DNS - my free Android networking tools app
Ramesh Manian
Greenhorn

Joined: Nov 10, 2009
Posts: 2
Thanks for the welcome.

I am adding the jdbc connector jar in my app's WEB-INF/lib directory.
Bear Bibeault
Author and ninkuma
Marshal

Joined: Jan 10, 2002
Posts: 60766
    
  65

Are you using container-managed connection pooling? If so, the jar file with the driver must be in the common/lib folder.


[Asking smart questions] [Bear's FrontMan] [About Bear] [Books by Bear]
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Mac OS X Tomcat classpath issues
 
Similar Threads
"..could not load JDBC driver."
Cocoon: No valid JdbcConnection class available
Java Problem running on Teminal in Mac OS X Leopard
Mac Error _initWithWindowNumber
Problems runing java prograns