Uploaded image for project: 'EJB 3.0'
  1. EJB 3.0
  2. EJBTHREE-458

@PersistenceUnit/@PersistenceContext on bean class does not work

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Done
    • Icon: Major Major
    • EJB 3.0 RC6 - PFD
    • EJB 3.0 RC5 - PFD
    • None
    • None

      This assertion fails:

      @Stateless
      @PersistenceUnit(name = "emf/caveatemptor1", unitName = "caveatemptorDatabase")
      public class InfrastructureBean implements Infrastructure {

      @Resource
      SessionContext ctx;

      public void lookupEntityManagerFactoryInJNDI()

      { EntityManagerFactory emf = (EntityManagerFactory)ctx.lookup("emf/caveatemptor1"); assert emf != null; }

      }

      The trace log is unusable, it contains no information about ENC population.

      Regular field/setter injection of a PU/EMF works, and it also correctly populates the ENC.

              patriot1burke@gmail.com Bill Burke (Inactive)
              christian.bauer_jira Christian Bauer (Inactive)
              Votes:
              0 Vote for this issue
              Watchers:
              0 Start watching this issue

                Created:
                Updated:
                Resolved: