title: Java PersistanceContext - null, blazeds remote service
body: <p>I am using PersistanceContext to inject EntityManager and its works when I use Java for back-end and front-end(JSF:Managed bean), but now i want to use Flex as front-end. I am using blazeds to connect between Java and Flex. I created simple test service that generates list and this works properly. Problem is when i tried to retrieve this list from my databases it turned out that my EntityManager is not injected by PersistanceContext. What i am doing wrong ?</p>
  
  <p>This is the service class:</p>
  
  <pre><code>public class simpleService {
      @PersistenceContext(unitName="gsitePU")    
      private EntityManager em;
  
      public List&lt;User&gt; getAllUser() {
          List&lt;User&gt; usersList = new ArrayList&lt;User&gt;();
          try {
              TypedQuery&lt;User&gt; query = em.createNamedQuery("User.findAll", User.class);
              usersList = query.getResultList();
          }
          catch(NoResultException e) {
  
          }
  
          return usersList;
  
      }
  }
  </code></pre>