Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Error "No suitable driver" with jdbc, tomcat, apache and mod-jk

I'm installing a webapp in amazon EC2 created by a software provider.

Enviroment details:

  • Operative System: ubuntu oneiric
  • java: oracle-java7-jre (taken from Eugenesan's PPA)
  • tomcat: repository tomcat7
  • apache: repository apache2
  • mod-jd: repository libapache2-mod-jk
  • mysql connector: repository libmysql-java

I follow this tutorial for deploy the web app with apache2+tomcat7+mod-jk.

Conf files:

  • /etc/tomcat7/server.xml
  • /etc/apache2/sites-enabled/planeador
  • /etc/libapache2-mod-jk/workers.properties (here I set tomcat path and java path)

I copied the file mysql-5.1.10.jar into /myapp/WEB-INF/lib and /usr/share/tomcat7/lib and /usr/lib/jvm/java-7-oracle/jre/lib (this is location for oracle-java7-jre package)

But when I go to the site (the dns is fine) and clic on any link I got this error:

ERR: Cannot create JDBC driver of class 'com.mysql.jdbc.Driver' for connect URL 'jdbc:mysql//planeador.c6qzkmwukf5s.us-east-1.rds.amazonaws.com:3306/planeador?autoReconnect=true&useUnicode=true&characterEncoding=UTF-8'

But I checked the access to database and is fine.

Any suggest? This is my first thime installing tomcat and that stuff, please If I'm missing some obvius part tell me.

Thanks

like image 524
diegueus9 Avatar asked Jan 26 '26 07:01

diegueus9


1 Answers

ERR: Cannot create JDBC driver of class 'com.mysql.jdbc.Driver' for connect URL 'jdbc:mysql//planeador.c6qzkmwukf5s.us-east-1.rds.amazonaws.com:3306/planeador?autoReconnect=true&useUnicode=true&characterEncoding=UTF-8'

You are missing a colon (:) between mysql and // in your connection url.

19.3.4.1. Driver/Datasource Class Names, URL Syntax and Configuration Properties for Connector/J

like image 92
Bhesh Gurung Avatar answered Jan 27 '26 21:01

Bhesh Gurung



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!