【发布时间】:2013-05-15 10:57:17
【问题描述】:
当我将我的 EJB3 实体(使用 @Entity 注释)从我的 EJB 模块中分离出来并将它们放在一个单独的 jar 文件中时,我的 Persistence.xml 文件应该放在我的 EJB 模块中还是我的 entity.jar 中?我应该如何部署entities.jar 文件?它不是 EJB 模块,因为它没有任何 EJB,只有 JPA 实体。
我正在使用 Glassfish,我所做的是将 entity.jar 放在 /lib/applibs 目录中,并在部署 EJB 模块时声明它使用该库。
但部署失败:
Internal Exception: java.lang.ClassNotFoundException: com.pedra.Role
javax.persistence.PersistenceException: Exception [TOPLINK-28018] (Oracle TopLink Essentials - 2.1 (Build b31g-fcs (10/19/2009))): oracle.toplink.essentials.exceptions.EntityManagerSetupException
Exception Description: predeploy for PersistenceUnit [SignonPU] failed.
Internal Exception: Exception [TOPLINK-30007] (Oracle TopLink Essentials - 2.1 (Build b31g-fcs (10/19/2009))): oracle.toplink.essentials.exceptions.PersistenceUnitLoadingException
Exception Description: An exception was thrown while loading class: com.pedra.Role to check whether it implements @Entity, @Embeddable, or @MappedSuperclass.
Internal Exception: java.lang.ClassNotFoundException: com.pedra.Role
那么为什么这个类在entities.jar 库中找不到呢?
【问题讨论】:
标签: jpa deployment ejb-3.0 classnotfoundexception glassfish-2.x