Sergei
Sergei

Reputation: 63

Ship JDBC driver into WAR for Tomcat 7

Before updating to Tomcat 7 (from Tomcat 6) I was able to ship MySql JDBC driver with a WAR file. I wasn't experiencing any issues creating JNDI data source with Tomcat 6 (maybe memory leaks on redeploy).

However, I'm attempting to deploy the same WAR (with the MySql driver) on Tomcat 7 using new connection pooling and getting : java.lang.ClassNotFoundException: com.mysql.jdbc.Driver

I do understand that the more appropriate place for JDBC drivers would be CATALINA_HOME/lib.

Does the new connection pooling absolutely requires all JDBC drivers to be in CATALINA_HOME/lib? Or some configuration can allow me to ship the driver within WAR.

Upvotes: 1

Views: 848

Answers (1)

Cratylus
Cratylus

Reputation: 54074

Yes. The driver should be in CATALINA_HOME\lib especially if you want to use Tomcat's pooling

From: Tomcat 7 Connection Pooling

Before you proceed, don't forget to copy the JDBC Driver's jar into $CATALINA_HOME/lib.

Upvotes: 3

Related Questions