[
https://issues.apache.org/jira/browse/OWB-534?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12999988#comment-12999988
]
Matthias Weßendorf commented on OWB-534:
----------------------------------------
Using a simple DAO (all in one class - no abstraction, no inheritance) makes it
working!
> Injection of @PersistenceContext does not work with abstract/base classes
> -------------------------------------------------------------------------
>
> Key: OWB-534
> URL: https://issues.apache.org/jira/browse/OWB-534
> Project: OpenWebBeans
> Issue Type: Bug
> Components: Injection and Lookup
> Affects Versions: 1.0.0
> Reporter: Matthias Weßendorf
> Assignee: Gurkan Erdogdu
> Priority: Critical
>
> 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
--
This message is automatically generated by JIRA.
-
For more information on JIRA, see: http://www.atlassian.com/software/jira