ear部署失败 - 无法解析引用Remote ejb-ref

时间:2012-09-12 19:03:39

标签: java glassfish ejb ear

我有以下 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在以下情况下正确部署:

  

无论是dao jar 还是战争都被忽略了。

即。

  

如果我删除了战争,EAR就会部署,而DAO中的Tester WebServices也能正常工作。

     

如果我删除了dao jar,那么EAR就会部署并且JSF Hello World启动/工作正常。

任何想法? 谢谢你的阅读。

1 个答案:

答案 0 :(得分:0)

也许你的dao.jar也包装在你的web.war中(不包含它)。

相关问题