Glassfisch MySQL ping ERROR

左心房为你撑大大i 提交于 2019-12-25 05:59:06

问题


i have an glassfish server and i try to use a mysql database.

what i did:

  • i installed glassfisch3
  • i added galssfish3/bin to environment variables
  • i installed a domain und glassfish3/glassfish/domains/domain1
  • i added mysql-connector-java-5.1.25-bin.jar to glassfish3/glassfish/domains/domain1/lib
  • i created a datasource in my glassfisch (Name: myDataSource, ClassName com.mysql.jdbc.jdbc2.optional.MysqlDataSource, Resource Type: javax.sql.DataSource)
  • i Saved everything

When i now go to my new created datasource and press the ping button i get this Error:

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

So whats wrong with it? official glassfisch3 doc says i did right


回答1:


I guess, by creating a datasource you mean a connection pool. Do you start your Glassfish from a command line or from an IDE? I had the same problem with Glassfish 4 when I was starting it from Netbeans 7.3.1 (Linux), but when I start it by

./bin/asadmin start-domain

it can find the driver. I don't know what gets wrong when using Netbeans.




回答2:


You should probably try to move the mysql-connector-java-5.1.25-bin.jar also to glassfish3/glassfish/lib. This is the global directory for libraries.



来源:https://stackoverflow.com/questions/16593060/glassfisch-mysql-ping-error

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!