I want to split the parts of my WAR application into different JAR components. Each JAR component contains JPA objects, EJBs, and JSF-Composite-Components.
Example: extracting user management (XHTML, EJB, JPA-Entities) in your own bank.
At first, everything looks fine until I need to use entityManager.
Problem: In EJB JAR files, entityManager will never be entered.
I am using @PersistenceContext annotation for injection.
I have beans.xml in all META-INF folders, and everything (except entityManager) is entered correctly. It does not matter whether the persistence.xml file is placed in all JAR files or only in the WAR file.
Does anyone have glue how can this be done?
Where do I need to place different configuration files (beans.xml, persistence.xml)?
Do I need an ejb-jar.xml file?
Is this even possible?
Technology-Stack: JBoss 6.1 / PrimeFaces 3.2 / Maven / EJB 3.1 / Hibernate / JTA / CDI
source share