Resolve "DSRA8040I ClassNotFoundException" in WebSphere

Home > Search
  by

This error appears when attempting to test the connection to a data source.

 

As the error suggests, the logs will also record this exception. In the example, the node agent SystemOut.log has the following.

DSRA0174W: Warning: GenericDataSourceHelper is being used.
DSRA8040I: Failed to connect to the DataSource "". Encounted java.lang.ClassNotFoundException: com.mysql.jdbc.jdbc2.optional.MysqlConnectionPoolDataSource

 

This error suggests some problem with the implementation class being used. In this example, the implementation class being used is com.mysql.jdbc.jdbc2.optional.MysqlConnectionPoolDataSource. The implementation class is obtained from the JAR file being used to connect to the database. Viewing the content of the JAR file can be used to determine the appropriate implementation class. The content of the JAR file will simply be a collection of files and directories. As an example, following is one of the files and directories in the MySQL JAR.

com/mysql/cj/jdbc/MysqlDataSource.class

 

From this we can conclude that the valid implementation class is actually com.mysql.cj.jdbc.MysqlConnectionPoolDataSource. Once you know the valid implementation class, the JDBC provider in WebSphere can be updated to have the valid implementation class.

  1. In the left panel of the WebSphere admin console, select Resources > JDBC JDBC Providers.
  2. Select your JDBC provider.
  3. Update the implementation class, and select OK.
  4. Select Save.

 

If there are no other issues with the JDBC and data source, the test connection should now be successful.



Add a Comment




We will never share your name or email with anyone. Enter your email if you would like to be notified when we respond to your comment.




Please enter in the box below so that we can be sure you are a human.




Comments