Uploaded image for project: 'OpenWebBeans'
  1. OpenWebBeans
  2. OWB-534

Injection of @PersistenceContext does not work with abstract/base classes

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Closed
    • Critical
    • Resolution: Duplicate
    • 1.0.0
    • 1.1.0, 1.1.9
    • Injection and Lookup
    • None

    Description

      I am using an "AbstractGenericDao" class for all of my DAOs.
      In there I use @PersistenceContext(unitName = "myUnit") to inject the EntityManager

      The concrete DAO (e.g. EmployeeDao (which extends AbstractGenericDao)) is inject (via @Inject) to a Service IMPL.

      Now, when executing some logic on that DAO, where it delegates to the EntityManager (e.g. em.persist(...) I am getting a NullPointerException, indicating that the EntityManager is NULL

      Attachments

        1. OWB-534.zip
          130 kB
          Matthias Wessendorf

        Issue Links

          Activity

            People

              struberg Mark Struberg
              matzew Matthias Wessendorf
              Votes:
              0 Vote for this issue
              Watchers:
              0 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: