I'm getting this error while running tomcat 'java.lang.ClassNotFoundException: com.mysql.jdbc.Driver'. I'm using a combination of Eclipse (Indigo, J2EE version) / Maven (m2e-wtp) / Tomcat 7.0. I've included this dependency in my pom file for my web application (build from scratch).
<dependency>
<groupId>mysql</groupId>
<artifactId>mysql-connector-java</artifactId>
<version>5.1.6</version>
</dependency>
I do not get any compilation errors in the 'Problems' view but when I run the Tomcat server from the 'Servers' view, I get these errors. It clearly indicates that Tomcat is unable to find the Class and it is classpath configuration error and I was hoping that maven would take care of this.
I looked at other issues related to 'java.lang.ClassNotFoundException: com.mysql.jdbc.Driver' but weren't of much help.
I would greatly appreciate any help.
/** This is how I load the Driver */
static {
DriverAdapterCPDS cpds_Customer = new DriverAdapterCPDS();
try { cpds_Customer.setDriver(productConfig.getProperty("dbcp.connection.customer.driver_class"));
} catch (ClassNotFoundException e) {
// log.error("setDriver Exception " + e);
e.printStackTrace();
}
}