Take the 2-minute tour ×

I have the following 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)         

I'm deploying it on Glassfish 3.1.2

When I attempt to package both in the EAR simultaneously I get the following deployment error:

     SEVERE: Exception while deploying the app [web-league-table-ear] : 
        Cannot resolve reference Remote ejb-ref 
        Remote 3.x interface =org.eclipse.persistence.jpa.rs.PersistenceFactory,
    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.

The EAR deploys correctly when:

Either the dao jar or the war are ommitted.


If I remove the war the EAR deploys and the Tester WebServices in the DAO work fine.

If I remove the dao jar the EAR deploys and the JSF Hello World launches/works fine.

Anyone any ideas? Thanks for reading.

share|improve this question
did you end up finding out a solution? –  Oliver Watkins Nov 21 '13 at 10:33
add comment

1 Answer

Maybe your dao.jar is also packaged inside your web.war (which shall not contains it).

share|improve this answer
add comment

Your Answer


