Hi, Where is the persistence.xml file in your ejb.jar? It should be in the META-INF directory.
The container will look for persistence.xml files in the following places (per JPA spec): In Java EE environments, the root of a persistence unit must be one of the following: • an EJB-JAR file • the WEB-INF/classes directory of a WAR file[80] • a jar file in the WEB-INF/lib directory of a WAR file • a jar file in the EAR library directory • an application client jar file In this case the root of the persistence unit is the directory that contains META-INF/persistence.xml, not the directory that contains persistence.xml. If you have it in one of the places listed above the OpenEJB should be able to find it. Regards, -mike On Thu, Jul 15, 2010 at 8:13 AM, Michael Simons <[email protected]>wrote: > Hello, > > I've declared a persistence-unit named "AtlantisWest" in my > persistence.xml, that I reference in > my bean by > @PersistenceContext(name="AtlantisWest", > type=PersistenceContextType.EXTENDED) > protected EntityManager entityManager; > > Can anybody please tell me what might cause the following exception when > deploying my bean: > > Caused by: org.apache.openejb.OpenEJBException: Error building bean > 'MapAuxiliaryServiceBw'. > Exception: class org.apache.openejb.OpenEJBException: PersistenceU > nit 'null' not found for EXTENDED ref 'AtlantisWest': PersistenceUnit > 'null' not found for > EXTENDED ref 'AtlantisWest' > at > org.apache.openejb.assembler.classic.EjbJarBuilder.build(EjbJarBuilder.java:64) > at > org.apache.openejb.assembler.classic.Assembler.createApplication(Assembler.java:489) > ... 52 more > Caused by: org.apache.openejb.OpenEJBException: PersistenceUnit 'null' not > found for EXTENDED > ref 'AtlantisWest' > at > > org.apache.openejb.assembler.classic.EnterpriseBeanBuilder.build(EnterpriseBeanBuilder.java:198) > at > org.apache.openejb.assembler.classic.EjbJarBuilder.build(EjbJarBuilder.java:52) > > > Kind Regards, Michael > >
