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

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

    XMLWordPrintableJSON

    Details

    • Type: Bug
    • Status: Closed
    • Priority: Critical
    • Resolution: Duplicate
    • Affects Version/s: 1.0.0
    • Fix Version/s: 1.1.0, 1.1.9
    • Component/s: Injection and Lookup
    • Labels:
      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

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

                Dates

                • Created:
                  Updated:
                  Resolved: