[
https://issues.jboss.org/browse/EJBTHREE-2256?page=com.atlassian.jira.plu...
]
Dirk Gerrit Oort commented on EJBTHREE-2256:
--------------------------------------------
I get the same error on a @Singleton bean and running jboss 6.0 final 50% of the cases.
The stacktrace is the same with the same line numbers
Caused by: java.lang.NullPointerException
20:29:40,043 ERROR [STDERR] at
org.jboss.ejb3.entity.ExtendedEntityManager.getPersistenceContext(ExtendedEntityManager.java:76)
20:29:40,043 ERROR [STDERR] at
org.jboss.ejb3.entity.ExtendedEntityManager.getEntityManager(ExtendedEntityManager.java:61)
20:29:40,043 ERROR [STDERR] at
org.jboss.ejb3.jpa.integration.JPA2EntityManagerDelegator.createQuery(JPA2EntityManagerDelegator.java:54)
20:29:40,043 ERROR [STDERR] at
org.oort.cms.sessions.SiteReadSession.openSite(SiteReadSession.java:32)
20:29:40,043 ERROR [STDERR] at
org.oort.cms.sessions.SiteReadSession.getSiteMapID(SiteReadSession.java:43)
20:29:40,043 ERROR [STDERR] at sun.reflect.NativeMethodAccessorImpl.invoke0(Native
Method)
20:29:40,043 ERROR [STDERR] at
sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
20:29:40,043 ERROR [STDERR] at
sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
20:29:40,043 ERROR [STDERR] at java.lang.reflect.Method.invoke(Method.java:597)
20:29:40,043 ERROR [STDERR] at
org.jboss.aop.joinpoint.MethodInvocation.invokeTarget(MethodInvocation.java:122)
20:29:40,044 ERROR [STDERR] at
org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:111)
20:29:40,044 ERROR [STDERR] at
org.jboss.ejb3.interceptors.container.ContainerMethodInvocationWrapper.invokeNext(ContainerMethodInvocationWrapper.java:72)
20:29:40,044 ERROR [STDERR] at
org.jboss.ejb3.interceptors.aop.InvocationContextInterceptor$InvocationContext.proceed(InvocationContextInterceptor.java:127)
20:29:40,044 ERROR [STDERR] at
org.jboss.weld.integration.ejb.interceptor.Jsr299BindingsInterceptor.doMethodInterception(Jsr299BindingsInterceptor.java:151)
20:29:40,044 ERROR [STDERR] at
org.jboss.weld.integration.ejb.interceptor.Jsr299BindingsInterceptor.doAroundInvoke(Jsr299BindingsInterceptor.java:122)
20:29:40,044 ERROR [STDERR] at sun.reflect.NativeMethodAccessorImpl.invoke0(Native
Method)
20:29:40,044 ERROR [STDERR] at
sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
20:29:40,044 ERROR [STDERR] at
sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
20:29:40,044 ERROR [STDERR] at java.lang.reflect.Method.invoke(Method.java:597)
20:29:40,044 ERROR [STDERR] at
org.jboss.ejb3.interceptors.aop.EJB3InterceptorInterceptor.invoke(EJB3InterceptorInterceptor.java:80)
20:29:40,044 ERROR [STDERR] at
org.jboss.ejb3.interceptors.aop.EJB3InterceptorInterceptor.invoke(EJB3InterceptorInterceptor.java:71)
20:29:40,044 ERROR [STDERR] at
org.jboss.ejb3.interceptors.container.ContainerMethodInvocationWrapper.invokeNext(ContainerMethodInvocationWrapper.java:62)
20:29:40,045 ERROR [STDERR] at
org.jboss.ejb3.interceptors.aop.InvocationContextInterceptor$InvocationContext.proceed(InvocationContextInterceptor.java:127)
20:29:40,045 ERROR [STDERR] at
org.jboss.weld.ejb.SessionBeanInterceptor.aroundInvoke(SessionBeanInterceptor.java:46)
20:29:40,045 ERROR [STDERR] at sun.reflect.NativeMethodAccessorImpl.invoke0(Native
Method)
20:29:40,045 ERROR [STDERR] at
sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
20:29:40,045 ERROR [STDERR] at
sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
20:29:40,045 ERROR [STDERR] at java.lang.reflect.Method.invoke(Method.java:597)
20:29:40,045 ERROR [STDERR] at
org.jboss.ejb3.interceptors.aop.EJB3InterceptorInterceptor.invoke(EJB3InterceptorInterceptor.java:80)
20:29:40,045 ERROR [STDERR] at
org.jboss.ejb3.interceptors.aop.EJB3InterceptorInterceptor.invoke(EJB3InterceptorInterceptor.java:71)
20:29:40,045 ERROR [STDERR] at
org.jboss.ejb3.interceptors.container.ContainerMethodInvocationWrapper.invokeNext(ContainerMethodInvocationWrapper.java:62)
20:29:40,045 ERROR [STDERR] at
org.jboss.ejb3.interceptors.aop.InterceptorSequencer.invoke(InterceptorSequencer.java:76)
20:29:40,045 ERROR [STDERR] at
org.jboss.ejb3.interceptors.aop.InterceptorSequencer.aroundInvoke(InterceptorSequencer.java:62)
20:29:40,046 ERROR [STDERR] at sun.reflect.NativeMethodAccessorImpl.invoke0(Native
Method)
20:29:40,046 ERROR [STDERR] at
sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
20:29:40,046 ERROR [STDERR] at
sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
20:29:40,046 ERROR [STDERR] at java.lang.reflect.Method.invoke(Method.java:597)
20:29:40,046 ERROR [STDERR] at
org.jboss.aop.advice.PerJoinpointAdvice.invoke(PerJoinpointAdvice.java:174)
20:29:40,046 ERROR [STDERR] at
org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:102)
20:29:40,046 ERROR [STDERR] at
org.jboss.ejb3.interceptors.aop.InvocationContextInterceptor.fillMethod(InvocationContextInterceptor.java:74)
20:29:40,046 ERROR [STDERR] at
org.jboss.aop.advice.org.jboss.ejb3.interceptors.aop.InvocationContextInterceptor_z_fillMethod_1788497806.invoke(InvocationContextInterceptor_z_fillMethod_1788497806.java)
20:29:40,046 ERROR [STDERR] at
org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:102)
20:29:40,046 ERROR [STDERR] at
org.jboss.ejb3.interceptors.aop.InvocationContextInterceptor.setup(InvocationContextInterceptor.java:90)
20:29:40,046 ERROR [STDERR] at
org.jboss.aop.advice.org.jboss.ejb3.interceptors.aop.InvocationContextInterceptor_z_setup_1788497806.invoke(InvocationContextInterceptor_z_setup_1788497806.java)
20:29:40,046 ERROR [STDERR] at
org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:102)
20:29:40,046 ERROR [STDERR] at
org.jboss.ejb3.async.impl.interceptor.AsynchronousServerInterceptor.invoke(AsynchronousServerInterceptor.java:128)
20:29:40,047 ERROR [STDERR] at
org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:102)
20:29:40,047 ERROR [STDERR] at
org.jboss.ejb3.connectionmanager.CachedConnectionInterceptor.invoke(CachedConnectionInterceptor.java:62)
20:29:40,047 ERROR [STDERR] at
org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:102)
20:29:40,047 ERROR [STDERR] at
org.jboss.ejb3.entity.TransactionScopedEntityManagerInterceptor.invoke(TransactionScopedEntityManagerInterceptor.java:56)
20:29:40,047 ERROR [STDERR] at
org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:102)
20:29:40,047 ERROR [STDERR] at
org.jboss.ejb3.concurrency.aop.interceptor.ContainerManagedConcurrencyInterceptor.invoke(ContainerManagedConcurrencyInterceptor.java:181)
20:29:40,047 ERROR [STDERR] at
org.jboss.aop.advice.PerInstanceInterceptor.invoke(PerInstanceInterceptor.java:86)
20:29:40,047 ERROR [STDERR] at
org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:102)
20:29:40,047 ERROR [STDERR] at
org.jboss.ejb3.AllowedOperationsInterceptor.invoke(AllowedOperationsInterceptor.java:47)
20:29:40,047 ERROR [STDERR] at
org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:102)
20:29:40,047 ERROR [STDERR] at
org.jboss.ejb3.tx.NullInterceptor.invoke(NullInterceptor.java:42)
20:29:40,047 ERROR [STDERR] at
org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:102)
20:29:40,048 ERROR [STDERR] at
org.jboss.ejb3.core.context.SessionInvocationContextAdapter.proceed(SessionInvocationContextAdapter.java:95)
20:29:40,048 ERROR [STDERR] at
org.jboss.ejb3.tx2.impl.CMTTxInterceptor.invokeInOurTx(CMTTxInterceptor.java:247)
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
Assignee: jaikiran pai
Attachments: com.acme.jpa.UserRepositoryTestCase.txt,
extended-entity-manager-in-slsb.zip
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