I came aboard a new project with a new company and we are trying to use JPA to do some DB work. So we have an Ear with an EJB, a webservice, and then there is a app client in the ear that really does all the work. The Webservice, calls the EJB, and the EJB calls the client to do the DB work. So within the appclient I want to load an EntityManager via annotations, but it does not seem to work (em is always null): @Entity public class Whatever...{ @PersistenceContext(unitName="pu") EntityManager em;
}
So I was thinking that I need to load the EntityManager at the EJB, but that didn't work either, because it seems that JPA didn't see the Entity classes since they are in the appclient and not the EJB. Can anyone give me some guidance?