2
votes

i put mysql driver into glassfish/admin1/lib and i get this error on trying make a connection with GlassFish 3.1.2

Ping Connection Pool failed for SimpleCRUD_ConnectionPool. Class name is wrong or classpath is not set for : com.mysql.jdbc.jdbc2.optional.MysqlDataSource Please check the server.log for more details.

Hare the configuration:

Pool Name: SimpleCRUD_ConnectionPool Resource Type: javax.sql.DataSource javax.sql.XADataSource Datasource Classname: com.mysql.jdbc.Driver

has someone any idea?

3

3 Answers

3
votes

A Driver and a DataSource are not the same. It looks from your configuration that you're setting a Driver class as the DataSource classname?

Do you really need XA? Are you doing any distributed transaction?

If so, set the data source to com.mysql.jdbc.jdbc2.optional.MysqlXADataSource

If not, select a regular DataSource type and then set the classname to com.mysql.jdbc.jdbc2.optional.MysqlDataSource

1
votes

For starters, the path where you have placed your driver does not look correct. For details on administering database connectivity in Glassfish 3.1.2 please see 12 Administering Database Connectivity

Also in that guide you will find a section installing the MySQL Server Database Type 4 Driver

If you need additional help, please post a screen capture of your JDBC resource and JDBC connection pool configuration or if you used it the asadmin command you used to create it.

-Noah

1
votes

No, you just lack mysql lib, just find and download mysql-connector-java-5.x.x-bin.jar copy to E:\Projects\glassfish3.1.1\glassfish\lib then restart server and enjoy !!!