[
https://issues.apache.org/jira/browse/OWB-359?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12859294#action_12859294
]
Gurkan Erdogdu commented on OWB-359:
------------------------------------
Yes, but NormalScopedBeanInterceptorHandler always uses CreationalContext of
the bean instance that was created
In getContextualInstance # NormalScopedBeanInterceptorHandler
............
if (webbeansContext instanceof AbstractContext)
{
CreationalContext<?> cc =
((AbstractContext)webbeansContext).getCreationalContext(bean);
if (cc != null)
{
creationalContext = new WeakReference<CreationalContext<?>>(cc);
}
}
It means that current thread looks for the right context of the bean instance
to get right creational context. This creational context may be owned by
different bean instances(different threads), and CreationalContextImpl was
written to handle such a case, (saving dependents on using bean instance as a
key) , so OWB351 not occurs.
> ownerCreationalContext sometimes causes NPE in
> InterceptorDataImpl.createNewInstance()
> --------------------------------------------------------------------------------------
>
> Key: OWB-359
> URL: https://issues.apache.org/jira/browse/OWB-359
> Project: OpenWebBeans
> Issue Type: Bug
> Components: Interceptor and Decorators
> Affects Versions: M4
> Reporter: Eric Covener
> Assignee: Gurkan Erdogdu
> Priority: Blocker
> Attachments: ownercc_npetest.diff
>
> Original Estimate: 4h
> Remaining Estimate: 4h
>
> I'm sporadically seeing InterceptorDataImpl.createNewInstance() called with a
> null ownerCreationalContext which results in an NPE. I haven't been able to
> figure out how we get there, but I have an update to a UT that can hit the
> same backtrace every once in a while.
> $ mvn
> -Dtest=org.apache.webbeans.newtests.interceptors.inheritance.InheritedInterceptorTest
> test
> testLoopNormalScopeNoNewInstance(org.apache.webbeans.newtests.interceptors.inheritance.InheritedInterceptorTest)
> Time elapsed: 0.551 sec <<< ERROR!
> java.lang.NullPointerException
> at
> org.apache.webbeans.intercept.InterceptorDataImpl.createNewInstance(InterceptorDataImpl.java:308)
> at
> org.apache.webbeans.intercept.InvocationContextImpl.proceedAroundInvokes(InvocationContextImpl.java:203)
> at
> org.apache.webbeans.intercept.InvocationContextImpl.proceed(InvocationContextImpl.java:155)
> at
> org.apache.webbeans.intercept.NormalScopedBeanInterceptorHandler.callAroundInvokes(NormalScopedBeanInterceptorHandler.java:82)
> at
> org.apache.webbeans.intercept.InterceptorHandler.invoke(InterceptorHandler.java:246)
> at
> org.apache.webbeans.intercept.NormalScopedBeanInterceptorHandler.invoke(NormalScopedBeanInterceptorHandler.java:70)
> at
> org.apache.webbeans.newtests.interceptors.inheritance.Deck_$$_javassist_18.shuffle(Deck_$$_javassist_18.java)
> at
> org.apache.webbeans.newtests.interceptors.inheritance.InheritedInterceptorTest.do_testNormalScopeNoNewInstance(InheritedInterceptorTest.java:121)
> at
> org.apache.webbeans.newtests.interceptors.inheritance.InheritedInterceptorTest.testLoopNormalScopeNoNewInstance(InheritedInterceptorTest.java:110)
> at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
> at
> sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:48)
> at
> sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:37)
> at java.lang.reflect.Method.invoke(Method.java:600)
> at
> org.junit.runners.model.FrameworkMethod$1.runReflectiveCall(FrameworkMethod.java:44)
> I know this area has had some very recent change, perhaps this makes sense to
> someone?
--
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.