私は次のEARを持っています:
dao.jar EJB-JAR (has a dependency on entities.jar)
web.war JSF-WAR (hello world jsf demo - no un-jsf dependencies)
/lib/entities.jar POJO-JAR (contains persistence.xml & entity classes)
Glassfish 3.1.2にデプロイしています
両方を同時に EAR にパッケージ化しようとすると、次の展開エラーが発生します。
SEVERE: Exception while deploying the app [web-league-table-ear] :
Cannot resolve reference Remote ejb-ref
name=org.eclipse.persistence.jpa.rs.Service/persistenceFactory,
Remote 3.x interface =org.eclipse.persistence.jpa.rs.PersistenceFactory,
ejb-link=null,lookup=,mappedName=,jndi-name=,refType=Session
because there are 2 ejbs in the application with interface org.eclipse.persistence.jpa.rs.PersistenceFactory.
Some of the possible causes:
1. The EJB bean class was packaged in an ear lib library (or through any other
library mechanism which makes the library visible to all component modules),
this makes all the component modules include this bean class indirectly.
2. The EJB bean class was packaged in a component module which references the
EJB, either directly or indirectly through Manifest, WEB-INF/lib.
The EJB bean class should only be packaged in the declaring ejb module and
not the referencing modules. The referencing modules should only
include EJB interfaces.
次の場合、EAR は正しくデプロイされます。
道壷か戦争のどちらかが省略されています。
すなわち
war を削除すると、EAR がデプロイされ、DAO の Tester WebServices が正常に動作します。
dao jar を削除すると、EAR がデプロイされ、JSF Hello World が正常に起動/動作します。
誰でもアイデアはありますか?読んでくれてありがとう。