7

I've downloaded WSO2 Stratos 1.5.2 platform. I'm trying to start wso2stratos-manager-1.5.2, but it doesn't find the mysql jdbc driver

[2012-08-08 16:31:15,201] ERROR {org.wso2.carbon.user.core.util.DatabaseUtil} - Database Error - Cannot load JDBC driver class 'com.mysql.jdbc.Driver' org.apache.commons.dbcp.SQLNestedException: Cannot load JDBC driver class 'com.mysql.jdbc.Driver'

Abimaran Kugathasan
  • 31,165
  • 11
  • 75
  • 105
guillaume
  • 6,477
  • 5
  • 17
  • 15

5 Answers5

10

I believe you're trying to use a mysql database as the backend database of the user management repository. Did you put the MySQL JDBC driver to MANAGER_HOME/repository/components/lib directory?

Regards, Prabath

Prabath Abeysekara
  • 1,085
  • 7
  • 20
  • there's already mysql-connector-java-5.1.12-bin.jar in MANAGER_HOME/repository/components/lib. FYI, I managed to start the Identity Server successfully. – guillaume Aug 09 '12 at 07:07
  • Can you please check whether there's any spaces (before/after) in the driver class name specified in "user-mgt.xml"? – Prabath Abeysekara Aug 09 '12 at 07:13
  • There's no blank space. Notice that I didn't have to add the driver jar myself, it was already embedded in the stratos package. – guillaume Aug 09 '12 at 07:25
  • As Rob Church says in below comment: "The target directory has changed for Enterprise Integrator. You should place the driver in /lib directory." – Tim van Steenbergen Mar 06 '19 at 10:28
8

We do not ship the mysql-connector jar with our packs due to license issues. Therefore you need to copy the jar to repository/components/lib folder as mentioned in Prabath's reply.

Regards, Amila.

Amila Maharachchi
  • 2,121
  • 2
  • 15
  • 21
2

As mentioned by others but adding specific details.

When configuring the Datasource Driver in many of the WSO2 products you need to specify the class name of the JDBC driver to use.

Make sure to copy the JDBC driver relevant to the database engine to the /repository/components/lib/ directory.

For example, if you are using MySQL, specify com.mysql.jdbc.Driver as the driver and copy mysql-connector-java-5.XX-bin.jar file to this directory.

If you do not copy the driver to this directory when you create the datasource, you will get an exception similar to Cannot load JDBC driver class com.mysql.jdbc.Driver.

Rob Church
  • 168
  • 10
  • 3
    The target directory has changed for Enterprise Integrator. You should place the driver in /lib directory. – Rob Church Jun 23 '17 at 18:47
0

Driver name is "com.mysql.jdbc.Driver". JAR file (mysql-connector-java-x.xx.xx.jar) must be present in MANAGER_HOME/repository/components/lib

Amito
  • 61
  • 4
0

I solved by adding the mysql jar file at the directory

C:\Program Files\WSO2\Identity Server\6.1.0\repository\components\lib

You can download jar by the following link: https://mvnrepository.com/artifact/mysql/mysql-connector-java/8.0.20

After that you should restart the WSO2 server

Abd Abughazaleh
  • 4,615
  • 3
  • 44
  • 53