0 Replies Latest reply on Aug 3, 2012 9:13 AM by ahuba

    Why does EntityManager injection work in 5.1 but not in 7.1.1?

    ahuba

      Hi

      My application gets the EntityManager and UserTransaction in each JSP file using the injection feature:

       

      <%! @PersistenceContext(unitName = "SSIS2")
         
      public EntityManager em;

         
      @Resource
         
      UserTransaction utx;
      %>

       

      I am not using the em and utx there, I distribute it to my controller classes to access the database.

      Why did this work in JBoss 5.1 but not in the new JBoss 7.1.1? According to the JSP specs it should not be permitted.

       

      How can I now retrieve the EntityManager and the UserTransaction?