[jboss-jira] [JBoss JIRA] Created: (EJBTHREE-2256) ExtendedEntityManager injected into Stateless Session Bean

gunter zeilinger (JIRA) jira-events at lists.jboss.org
Fri Jun 10 17:42:59 EDT 2011


ExtendedEntityManager injected into Stateless Session Bean
----------------------------------------------------------

                 Key: EJBTHREE-2256
                 URL: https://issues.jboss.org/browse/EJBTHREE-2256
             Project: EJB 3.0
          Issue Type: Bug
          Components: injection
         Environment: Running Arquillian 1.0.0.Alpha5 JUnit testcase with jbossas-remote-6 in jboss-6.0.0.Final
            Reporter: gunter zeilinger


Injecting a Stateless and a Stateful Session Bean - the later with an Extended Presentation Context - into a managed object:
{code}
@RunWith(Arquillian.class)
public class MyTest {

@EJB
private MySFSB sfsb;

@EJB
private MySLSB slsb;
:
{code}
may cause that the {{ExtendedEntityManager}} from the SFSB get also injected into the SLSB, which results in:
{noformat}
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)
...
{noformat}
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.

--
This message is automatically generated by JIRA.
For more information on JIRA, see: http://www.atlassian.com/software/jira

        


More information about the jboss-jira mailing list