Problem using MySQL JDBC on Tomcat 5.5 and Ubuntu 8.04

Normally when I build a web application that connects to a MySQL database, I would place the mysql-connector-java-bin.jar file into the WEB-INF/lib of the web application.

However, when I deployed the application on Tomcat 5.5 on Ubuntu 8.04 I got an exception: java.lang.ClassNotFoundException: com.mysql.jdbc.Driver

I couldn’t find the reason which caused the exception, so I did a quick fix by placing the jar file into the Tomcat’s common lib directory.

$ cp mysql-connector-java-bin.jar /usr/share/java
$ cd /usr/share/tomcat5.5/common/lib
$ ln -s ../../../java/mysql-connector-java-bin.jar mysql-connector-java-bin.jar

Related posts:

  1. Tomcat 5.5 Doesn’t Start in Ubuntu 7.10
  2. MySQL for Ubuntu Quickstart Guide
  3. Tomcat 5.5 for Ubuntu Quickstart Guide
  4. Problems with Ubuntu 7.10 and Tomcat 5.5
  5. Integrating Tomcat and Apache with mod_jk Connector
This entry was posted in Java, MySQL, Tomcat, Ubuntu and tagged , , , . Bookmark the permalink.

Comments are closed.