EJB3 エンティティ (@Entity でアノテーションを付けたもの) を EJB モジュールから分離し、別の jar ファイルに配置する場合、Persistence.xml ファイルは EJB モジュールまたは entities.jar のどこに移動する必要がありますか? また、entities.jar ファイルをデプロイするにはどうすればよいですか? EJB を持たず、JPA エンティティのみであるため、EJB モジュールではありません。
私は Glassfish を使用しており、entities.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 ライブラリにあるのに、なぜこのクラスが見つからないのでしょうか?