title: Including a JPA-Project in a JAX-RS REST-Service Application
body: <p>I have written a JPA-Project which encapsulates all my entities. Since these entities are also needed in the REST-Service project I exported the JPA-Project as a *.jar and included it in the REST-project (this has no JPA-Facet).</p>
  
  <p>So everything can be deployed on the server and I can reach the REST-services from the frontend, but as soon as the EntityManager should be injected in a class nothing happens.
  This results in NullPointerExceptions since the entityManager is not present.</p>
  
  <p>The classes in which to inject are marked as <code>@Stateless</code> and the entityManager with the <code>@PersistenceContext</code> annotation.</p>
  
  <p>So the question is: does injection work in a nested project or do I have to instantiate the entityManager manually?</p>
  
  <p>Thanks in advance!</p>
  
  <p>In Addition, I am using Glassfish v 3.1.2 and JPA 2.0</p>