【发布时间】:2012-06-10 02:14:08
【问题描述】:
Glassfish 未加载 com.mysql.jdbc.jdbc2.optional.MysqlXADataSource 包。
抛出以下错误
javax.persistence.PersistenceException: Exception [EclipseLink-4002] (Eclipse Persistence
Services - 2.3.2.v20111125-r10461): org.eclipse.persistence.exceptions.DatabaseException
Internal Exception: java.sql.SQLException:
Error in allocating a connection. Cause: Class name is wrong or classpath is not set
for:com.mysql.jdbc.jdbc2.optional.MysqlXADataSource
Error Code: 0 at org.eclipse.persistence.internal.jpa.EntityManagerSetupImpl.deploy
(EntityManagerSetupImpl.java:517)...
我已将mysql-connector jar 文件复制到Glassfish 的lib 目录,但仍然出现上述错误。
如何确保 Glassfish 可以为我部署的应用程序找到我的 JDBC 驱动程序?
【问题讨论】:
-
Sara,我发布了一个答案,可能会为您指明正确的方向。但是,如果您编辑您的问题,使其包含您在 Glassfish 日志文件中看到的错误,那就太好了。
-
@Rob,完成!我仍然有这个问题。
-
好的,莎拉,谢谢。编辑以使用更具体的信息来回答。
标签: eclipse deployment glassfish ear