You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@openwebbeans.apache.org by "Matthias Weßendorf (JIRA)" <ji...@apache.org> on 2011/02/27 17:42:40 UTC

[jira] Updated: (OWB-534) Injection of @PersistenceContext does not work with abstract/base classes

     [ https://issues.apache.org/jira/browse/OWB-534?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Matthias Weßendorf updated OWB-534:
-----------------------------------

    Attachment: OWB-534.zip

The example application.

Shows the bug (on default)
and has (as described in my comments) an undesired "work around".

> 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
>         Attachments: OWB-534.zip
>
>
> 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