-
Bug
-
Resolution: Unresolved
-
Major
-
None
-
None
-
None
Injecting a Stateless and a Stateful Session Bean - the later with an Extended Presentation Context - into a managed object:
@RunWith(Arquillian.class) public class MyTest { @EJB private MySFSB sfsb; @EJB private MySLSB slsb; :
may cause that the ExtendedEntityManager from the SFSB get also injected into the SLSB, which results in:
java.lang.NullPointerException at org.jboss.ejb3.entity.ExtendedEntityManager.getPersistenceContext(ExtendedEntityManager.java:76) at org.jboss.ejb3.entity.ExtendedEntityManager.getEntityManager(ExtendedEntityManager.java:61) at org.jboss.ejb3.jpa.integration.JPA2EntityManagerDelegator.createNamedQuery(JPA2EntityManagerDelegator.java:44) at MySLSB.foo(MySLSB.java:57) 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.jboss.aop.joinpoint.MethodInvocation.invokeTarget(MethodInvocation.java:122) at org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:111) at org.jboss.ejb3.interceptors.container.ContainerMethodInvocationWrapper.invokeNext(ContainerMethodInvocationWrapper.java:72) at org.jboss.ejb3.interceptors.aop.InterceptorSequencer.invoke(InterceptorSequencer.java:76) at org.jboss.ejb3.interceptors.aop.InterceptorSequencer.aroundInvoke(InterceptorSequencer.java:62) ...
The failure does not occur on each run - sometimes the SLSB get its own org.jboss.jpa.tx.TransactionScopedEntityManager injected as expected, and the test passes.