我以前做过这个,但出于某种原因,我在创建这个连接池时遇到了一些困难。当我在创建连接池后对连接池执行 ping 操作时,出现此错误:
Ping Connection Pool for bondsaver is Failed.
Ping failed Exception - Class name is wrong or classpath is not set for : com.mysql.jdbc.jdbc2.optional.MysqlDataSource
Please check the server.log for more details.
Ping failed Exception - Class name is wrong or classpath is not set for : com.mysql.jdbc.jdbc2.optional.MysqlDataSource
Please check the server.log for more details.
我在创建池时提供的信息如下:
端口号
:3306;数据库名称
: bonsaverdb;serverName
: localhost;用户
:root;密码
:我的密码;
有什么我遗漏的吗?我有什么拼写错误或输入错误的吗?
提前致谢!
最佳答案
似乎是类路径问题。您域的 lib 目录中是否有 mysql 连接器?
正确的路径应该是:
glassfish-install-dir\glassfish\domains\domain1\lib
(或不同的域名,如果您不使用默认的 domain1)
关于mysql - 努力在 Glassfish 上创建 MySQL 连接池,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/10413090/