This week's giveaway is in the JDBC forum.
We're giving away four copies of Java Database Connections & Transactions (e-book only) and have Marco Behler on-line!
See this thread for details.
Win a copy of Java Database Connections & Transactions (e-book only) this week in the JDBC forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Devaka Cooray
  • Knute Snortum
  • Paul Clapham
  • Tim Cooke
Sheriffs:
  • Liutauras Vilda
  • Jeanne Boyarsky
  • Bear Bibeault
Saloon Keepers:
  • Tim Moores
  • Stephan van Hulst
  • Ron McLeod
  • Piet Souris
  • Frits Walraven
Bartenders:
  • Ganesh Patekar
  • Tim Holloway
  • salvin francis

Mac OS X Tomcat classpath issues  RSS feed

 
Greenhorn
Posts: 2
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
 
Rancher
Posts: 43009
76
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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.
 
Ramesh Manian
Greenhorn
Posts: 2
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thanks for the welcome.

I am adding the jdbc connector jar in my app's WEB-INF/lib directory.
 
Sheriff
Posts: 67261
170
IntelliJ IDE Java jQuery Mac Mac OS X
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Are you using container-managed connection pooling? If so, the jar file with the driver must be in the common/lib folder.
 
F is for finger. Can you stick your finger in your nose? Doesn't that feel nice? Now try this tiny ad:
how do I do my own kindle-like thing - without amazon
https://coderanch.com/t/711421/engineering/kindle-amazon
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!