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:36:39 UTC

[jira] Commented: (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:comment-tabpanel&focusedCommentId=12999987#comment-12999987 ] 

Matthias Weßendorf commented on OWB-534:
----------------------------------------

Stack trace:


Caused by: java.lang.NullPointerException
	at net.wessendorf.enterprise.jpa.dao.AbstractGenericDao.create(AbstractGenericDao.java:16)
	at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
	at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
	at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
	at java.lang.reflect.Method.invoke(Method.java:597)
	at org.apache.webbeans.intercept.InvocationContextImpl.proceedAroundInvokes(InvocationContextImpl.java:255)
	at org.apache.webbeans.intercept.InvocationContextImpl.proceed(InvocationContextImpl.java:175)
	at org.apache.myfaces.extensions.cdi.jpa.impl.TransactionalInterceptor.invoke(TransactionalInterceptor.java:139)
	at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
	at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
	at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
	at java.lang.reflect.Method.invoke(Method.java:597)
	at org.apache.webbeans.intercept.InvocationContextImpl.proceedAroundInvokes(InvocationContextImpl.java:237)
	at org.apache.webbeans.intercept.InvocationContextImpl.proceed(InvocationContextImpl.java:175)
	at org.apache.webbeans.intercept.DependentScopedBeanInterceptorHandler.callAroundInvokes(DependentScopedBeanInterceptorHandler.java:86)
	at org.apache.webbeans.intercept.InterceptorHandler.invoke(InterceptorHandler.java:266)
	at org.apache.webbeans.intercept.DependentScopedBeanInterceptorHandler.invoke(DependentScopedBeanInterceptorHandler.java:75)
	at net.wessendorf.enterprise.jpa.dao.EmployeeDaoImpl_$$_javassist_32.create(EmployeeDaoImpl_$$_javassist_32.java)
	at net.wessendorf.enterprise.service.EmployeeServiceImpl.saveEmployee(EmployeeServiceImpl.java:38)
	at net.wessendorf.enterprise.faces.CreateEmployeeController.createEmployee(CreateEmployeeController.java:34)
	at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
	at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
	at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
	at java.lang.reflect.Method.invoke(Method.java:597)
	at org.apache.webbeans.intercept.InterceptorHandler.invoke(InterceptorHandler.java:287)
	at org.apache.webbeans.intercept.NormalScopedBeanInterceptorHandler.invoke(NormalScopedBeanInterceptorHandler.java:98)
	at net.wessendorf.enterprise.faces.CreateEmployeeController_$$_javassist_31.createEmployee(CreateEmployeeController_$$_javassist_31.java)
	at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
	at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
	at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
	at java.lang.reflect.Method.invoke(Method.java:597)
	at com.sun.el.parser.AstValue.invoke(AstValue.java:234)
	at com.sun.el.MethodExpressionImpl.invoke(MethodExpressionImpl.java:297)
	at org.apache.myfaces.view.facelets.el.TagMethodExpression.invoke(TagMethodExpression.java:83)
	... 42 more

> 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