tomee-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Romain Manni-Bucau (JIRA)" <j...@apache.org>
Subject [jira] [Comment Edited] (TOMEE-2055) NPE when @AroundConstruct Interceptor is defined on EJB
Date Thu, 08 Jun 2017 14:55:18 GMT

    [ https://issues.apache.org/jira/browse/TOMEE-2055?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16042776#comment-16042776
] 

Romain Manni-Bucau edited comment on TOMEE-2055 at 6/8/17 2:54 PM:
-------------------------------------------------------------------

interceptors are created after produce call but for cdi interceptor it is called likely during
this call (then we merge it - that was my fix). I guess your issue comes fro the @Interceptors
usage. We should add it to https://github.com/apache/tomee/blob/4a09afb5bdc240dfce8056196592b6448ab5c538/container/openejb-core/src/test/java/org/apache/openejb/cdi/AroundConstructCdiTest.java

edit: added one @Interceptors in the test


was (Author: romain.manni-bucau):
interceptors are created after produce call but for cdi interceptor it is called likely during
this call (then we merge it - that was my fix). I guess your issue comes fro the @Interceptors
usage. We should add it to https://github.com/apache/tomee/blob/4a09afb5bdc240dfce8056196592b6448ab5c538/container/openejb-core/src/test/java/org/apache/openejb/cdi/AroundConstructCdiTest.java

> NPE when @AroundConstruct Interceptor is defined on EJB
> -------------------------------------------------------
>
>                 Key: TOMEE-2055
>                 URL: https://issues.apache.org/jira/browse/TOMEE-2055
>             Project: TomEE
>          Issue Type: Bug
>          Components: TomEE Core Server
>    Affects Versions: 7.0.3
>            Reporter: Katya Todorova
>            Assignee: Romain Manni-Bucau
>             Fix For: 7.0.4
>
>         Attachments: interceptors-example-fail.war
>
>
> When @AroundConstruct Interceptor is defined on an EJB, a NPE is thrown (stacktrace below).
 A test app attached to reproduce the issue. (e.g .request url http://localhost:8080/interceptors-example-fail/TestServlet)
> Some observations while debugging the issue:
> org.apache.openejb.cdi.CdiEjbBean$EjbInjectionTargetImpl#createNewPojo replies on org.apache.webbeans.portable.AbstractProducer#createInterceptorInstances
to create interceptor instances. It seems that org.apache.openejb.BeanContext#mergeOWBAndOpenEJBInfo
doesn't fill AbstractProducer#interceptorInfo with ejbInterceptors although they are discovered
and stored in the corresponding openejb beanContext.
> javax.ejb.NoSuchEJBException: Singleton failed to initialize
> 	org.apache.openejb.core.singleton.SingletonInstanceManager.createInstance(SingletonInstanceManager.java:210)
> 	org.apache.openejb.core.singleton.SingletonInstanceManager.access$100(SingletonInstanceManager.java:69)
> 	org.apache.openejb.core.singleton.SingletonInstanceManager$1.call(SingletonInstanceManager.java:120)
> 	org.apache.openejb.core.singleton.SingletonInstanceManager$1.call(SingletonInstanceManager.java:118)
> 	java.util.concurrent.FutureTask.run(FutureTask.java:266)
> 	org.apache.openejb.core.singleton.SingletonInstanceManager.getInstance(SingletonInstanceManager.java:129)
> 	org.apache.openejb.core.singleton.SingletonContainer.invoke(SingletonContainer.java:209)
> 	org.apache.openejb.core.ivm.EjbObjectProxyHandler.synchronizedBusinessMethod(EjbObjectProxyHandler.java:265)
> 	org.apache.openejb.core.ivm.EjbObjectProxyHandler.businessMethod(EjbObjectProxyHandler.java:260)
> 	org.apache.openejb.core.ivm.EjbObjectProxyHandler._invoke(EjbObjectProxyHandler.java:89)
> 	org.apache.openejb.core.ivm.BaseEjbProxyHandler.invoke(BaseEjbProxyHandler.java:347)
> 	test.TestBean$$LocalBeanProxy.test(test/TestBean.java)
> 	test.TestServlet.doGet(TestServlet.java:35)
> 	javax.servlet.http.HttpServlet.service(HttpServlet.java:622)
> 	javax.servlet.http.HttpServlet.service(HttpServlet.java:729)
> 	org.apache.tomcat.websocket.server.WsFilter.doFilter(WsFilter.java:52)
> 	org.apache.openejb.server.httpd.EEFilter.doFilter(EEFilter.java:65)
> root cause
> java.lang.NullPointerException
> 	sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
> 	sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
> 	sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
> 	java.lang.reflect.Method.invoke(Method.java:498)
> 	org.apache.webbeans.component.InterceptorBean.intercept(InterceptorBean.java:152)
> 	org.apache.webbeans.intercept.InterceptorInvocationContext.proceed(InterceptorInvocationContext.java:63)
> 	org.apache.webbeans.portable.InjectionTargetImpl.produce(InjectionTargetImpl.java:163)
> 	org.apache.openejb.cdi.CdiEjbBean$EjbInjectionTargetImpl.createNewPojo(CdiEjbBean.java:525)
> 	org.apache.openejb.BeanContext.newInstance(BeanContext.java:1595)
> 	org.apache.openejb.core.singleton.SingletonInstanceManager.createInstance(SingletonInstanceManager.java:179)
> 	org.apache.openejb.core.singleton.SingletonInstanceManager.access$100(SingletonInstanceManager.java:69)
> 	org.apache.openejb.core.singleton.SingletonInstanceManager$1.call(SingletonInstanceManager.java:120)
> 	org.apache.openejb.core.singleton.SingletonInstanceManager$1.call(SingletonInstanceManager.java:118)
> 	java.util.concurrent.FutureTask.run(FutureTask.java:266)
> 	org.apache.openejb.core.singleton.SingletonInstanceManager.getInstance(SingletonInstanceManager.java:129)
> 	org.apache.openejb.core.singleton.SingletonContainer.invoke(SingletonContainer.java:209)
> 	org.apache.openejb.core.ivm.EjbObjectProxyHandler.synchronizedBusinessMethod(EjbObjectProxyHandler.java:265)
> 	org.apache.openejb.core.ivm.EjbObjectProxyHandler.businessMethod(EjbObjectProxyHandler.java:260)
> 	org.apache.openejb.core.ivm.EjbObjectProxyHandler._invoke(EjbObjectProxyHandler.java:89)
> 	org.apache.openejb.core.ivm.BaseEjbProxyHandler.invoke(BaseEjbProxyHandler.java:347)
> 	test.TestBean$$LocalBeanProxy.test(test/TestBean.java)
> 	test.TestServlet.doGet(TestServlet.java:35)
> 	javax.servlet.http.HttpServlet.service(HttpServlet.java:622)
> 	javax.servlet.http.HttpServlet.service(HttpServlet.java:729)
> 	org.apache.tomcat.websocket.server.WsFilter.doFilter(WsFilter.java:52)
> 	org.apache.openejb.server.httpd.EEFilter.doFilter(EEFilter.java:65)
>  



--
This message was sent by Atlassian JIRA
(v6.3.15#6346)

Mime
View raw message