Search code examples
javatomcatjdbcapache2mod-jk

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:

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


Solution

  • 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