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



我有以下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中的TesterWebServices可以正常工作。

如果我移除dao jar,EAR就会部署,JSF Hello World就会启动/运行良好。

有什么想法吗?感谢阅读。

也许你的dao.jar也被打包在你的web.war中(它不应该包含它)。

最新更新