我有以下耳朵:
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 在以下情况下正确部署:
无论是道坛还是战争都被省略了。
IE
如果我删除 EAR 部署的战争,DAO 中的 Tester WebServices 工作正常。
如果我删除 EAR 部署的 dao jar 并且 JSF Hello World 启动/工作正常。
有人有什么想法吗?谢谢阅读。