There is a similar question here but regarding the class path. ClassNotFoundException com.mysql.jdbc.Driver
I've had everything working great until some days ago. Suddenly my little application can't find the mysql driver. And i don't understand why (really I've checked everything)
I got the driver jar in the WEB-INF/lib, but tomcat just seems unable to find it.
Anyone got any ideas why? I'm using Ubuntu with tomcat 6 and mysql installed from the synaptics packadge manager
The error that is giving is:
ClassNotFoundException: com.mysql.jdbc.Driver
I've even changed the permissions into 777 to see if it could be invisibile, but it isn't :(
If you created a datasource which requires this driver, then it should be placed directly in the classpath of the container which manages the datasource. In this case, it's Tomcat which manages the datasource. Thus, with placing the driver in Tomcat/lib
you'll be fine.
Apart from that, you told you're using Ubuntu. It ships by default with a GNU JDK. I would only highly recommend that you ensure that you get rid of it and install the Sun JDK instead. The GNU JDK is cluttered of bugs which may cause at first sight unexplainable problems. Hope you take this into consideration.
Try putting the MySQL JDBC driver in $CATALINA_HOME/lib
and restart the web server. Also, make sure the tomcat user (or whatever user you are running tomcat as) has permissions to read it.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With