Bug #91068 Problems with Connector/J 8.0 in GlassFish
Submitted: 30 May 2018 7:52 Modified: 10 Jun 2018 17:32
Reporter: Pau Micó Email Updates:
Status: Not a Bug Impact on me:
None 
Category:Connector / J Severity:S3 (Non-critical)
Version:8.0 OS:Any
Assigned to: CPU Architecture:Any
Tags: Connector/J, glassfish

[30 May 2018 7:52] Pau Micó
Description:
Directly from GlassFish admin console, you can create a JDBC Connection Pool against the MySQL Server 8.0 (using the Connector/J 8.0 driver).
When you try to ping the pool you get the following error: "Ping Connection Pool failed for XXXYYYPool. Class name is wrong or classpath is not set for : com.mysql.jdbc.jdbc2.optional.MysqlDataSource Please check the server.log for more details"

The same problem seems to be reported in the thread: https://dev.mysql.com/doc/connector-j/5.1/en/connector-j-usagenotes-glassfish-config.html
But no fix is suggested.

How to repeat:
You can also use NetBeans to directly create the glassfish-resources.xml file and deploy it on the GlassFish server. Again, when you try to ping the pool the same error is obtained.
[7 Jun 2018 9:56] Filipe Silva
Hi,

Thanks for taking the time to report this.

The data source factory has moved to a different package in Connector/J 8.0. It can now be found in com.mysql.cj.jdbc.MysqlDataSource.

Can you please try the workaround mentioned in the comments on the same page you pointed out, but using this FQDN instead?

Thank you,
[8 Jun 2018 16:08] Pau Micó
Yep. Problem solved. Thanks!
[10 Jun 2018 17:32] Filipe Silva
Great! Thanks for your feedback.

Closing as "not a bug".

Happy coding!
[1 Sep 2018 10:11] ESHABIL BULBUL
I run into similar problems about connection from jar to timezone issues with MYSQL8 on windows 10 + Netbeans. I put the fix in this repository.

https://github.com/esabilbulbul/mysql-jdbc-windows/blob/master/README.md