users@jersey.java.net

[Jersey] Re: _at_PersistenceContext

From: Marek Potociar <marek.potociar_at_oracle.com>
Date: Mon, 21 May 2012 11:48:36 +0200

Shouldn't this go into some Hibernat/EJB/... discussion? I don't see a direct connection between the issue and Jersey.

Marek

On May 18, 2012, at 11:58 PM, mbrown_at_hayneedle.com wrote:

> We have a JAR file that contains DAO and DAOImpl classes. We have one
> abstract BaseDAOImpl class that creates EntityManager instance
> variables via @PersistenceContext.
>
> When this JAR file gets packaged up in a WAR file with jersey services
> and other code all is fine.
>
>
> When this JAR file gets packaged into an EAR with an EJB jar file the
> EntityManagers are always null.
>
> I would imagine this isn't a completely unusual use case. Has anyone
> run into / overcome this sort of thing?
>
> When the EAR is deployed we see hibernate find all of the persistence
> units its just at runtime we can't get the EMs built.