I want to inject an EM into a Servlet, the persistence unit is declared in the EJB JAR. I have an EAR with an EJB JAR and a WAR.
The problem is that I get this error:
Could not resolve a persistence unit corresponding to the persistence-context-ref-name [cvu.JpaServlet/em] in the scope of the module called
If I put the persistence.xml in the WAR it works ok, but I don't want to do that.
Can I get an EntityManager from the PersistenceUnit (persistence.xml) declared in EJB JAR ?