wso2 manager - com.mysql.jdbc.Driver not found
Asked Answered
S

5

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'

Solmization answered 8/8, 2012 at 14:44 Comment(0)
G
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

Gilboa answered 9/8, 2012 at 1:37 Comment(4)
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.Solmization
Can you please check whether there's any spaces (before/after) in the driver class name specified in "user-mgt.xml"?Gilboa
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.Solmization
As Rob Church says in below comment: "The target directory has changed for Enterprise Integrator. You should place the driver in <EI_HOME>/lib directory."Elidiaelie
M
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.

Motorboating answered 9/8, 2012 at 5:44 Comment(3)
mysql-connector-java-5.1.12-bin.jar is in MANAGER_HOME/repository/components/lib, so you do ship the mysql driver in stratos package.Solmization
mine didn't have the jarStowage
I cannot recall about what @Solmization has mentioned since it is about an old product. But we cannot ship the driver due to the license mismatches I have mentioned.Motorboating
B
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.

Birmingham answered 18/4, 2015 at 16:53 Comment(1)
The target directory has changed for Enterprise Integrator. You should place the driver in <EI_HOME>/lib directory.Birmingham
P
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

Paripinnate answered 22/10, 2019 at 13:35 Comment(0)
S
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

Stubble answered 14/2, 2023 at 11:18 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.