0 Replies Latest reply on Sep 18, 2013 2:32 PM by ronsi

    @PersistenceContext null in JBOSS 7.1.1

    ronsi

      I have an ear file in which I have 1 jar and 1 war file. The jar is an EJB jar and contains persistence.xml in its META-INF folder. In the jar I have SLSB which extend from an abstract BaseBean.java. In BaseBean.java I have an EntityManager which is injected using @PersistenceContext annotation. But during runtime EntityManager remains null. This is a seam application so I have components.xml in the war file.

       

      But if do Persistence.createEntityManagerFactory("persistenceUnitName") I'm able to get an instance of entity manager factory and create an EntityManager out of it.

       

      Any idea/pointers why @PersistenceContext is not injecting the EntityManager? I'm going nuts over this issue and have already spent few days on this alone.