You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@openwebbeans.apache.org by "Mark Struberg (JIRA)" <ji...@apache.org> on 2013/04/10 22:55:15 UTC

[jira] [Resolved] (OWB-556) bean with interceptor + @PreDestroy causes a NullPointerException

     [ https://issues.apache.org/jira/browse/OWB-556?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Mark Struberg resolved OWB-556.
-------------------------------

    Resolution: Fixed

all the interceptor code got completely rewritten in owb-1.2.0
                
> bean with interceptor + @PreDestroy causes a NullPointerException
> -----------------------------------------------------------------
>
>                 Key: OWB-556
>                 URL: https://issues.apache.org/jira/browse/OWB-556
>             Project: OpenWebBeans
>          Issue Type: Bug
>          Components: Context and Scopes
>    Affects Versions: 1.1.0
>            Reporter: Gerhard Petracek
>            Assignee: Mark Struberg
>             Fix For: 1.2.0
>
>
> AbstractInjectionTargetBean#preDestroyDefault
>   InvocationContextImpl impl = new InvocationContextImpl(
>     getWebBeansContext(), null, instance, null, null, getWebBeansContext().getInterceptorUtil().getInterceptorMethods(getInterceptorStack(), InterceptorType.PRE_DESTROY), InterceptorType.PRE_DESTROY);
> ... the 2nd parameter is the bean
> the constructor of InvocationContextImpl calls
>   configureTarget(bean); 
> which uses
>   bean.getScope()
> ->
> org.apache.webbeans.component.ManagedBean destroy
> Exception thrown while destroying bean instance : [Name:null,WebBeans Type:MANAGED,API Types:[...]
> java.lang.NullPointerException
>         at org.apache.webbeans.intercept.InvocationContextImpl.configureTarget(InvocationContextImpl.java:131)
>         at org.apache.webbeans.intercept.InvocationContextImpl.<init>(InvocationContextImpl.java:97)
>         at org.apache.webbeans.component.AbstractInjectionTargetBean.preDestroyDefault(AbstractInjectionTargetBean.java:288)
>         at org.apache.webbeans.component.AbstractInjectionTargetBean.preDestroy(AbstractInjectionTargetBean.java:273)
>         at org.apache.webbeans.component.AbstractInjectionTargetBean.destroyComponentInstance(AbstractInjectionTargetBean.java:194)
>         at org.apache.webbeans.component.AbstractInjectionTargetBean.destroyInstance(AbstractInjectionTargetBean.java:173)
>         at org.apache.webbeans.component.AbstractOwbBean.destroyCreatedInstance(AbstractOwbBean.java:277)
>         at org.apache.webbeans.portable.creation.InjectionTargetProducer.preDestroy(InjectionTargetProducer.java:134)
>         at org.apache.webbeans.component.InjectionTargetWrapper.preDestroy(InjectionTargetWrapper.java:104)
>         at org.apache.webbeans.component.AbstractOwbBean.destroy(AbstractOwbBean.java:241)
>         at org.apache.webbeans.context.AbstractContext.destroyInstance(AbstractContext.java:257)
>         at org.apache.webbeans.context.AbstractContext.destroy(AbstractContext.java:279)
>         at org.apache.webbeans.web.context.ServletRequestContext.destroy(ServletRequestContext.java:62)
>         at org.apache.webbeans.web.context.WebContextsService.destroyRequestContext(WebContextsService.java:348)
>         at org.apache.webbeans.web.context.WebContextsService.endContext(WebContextsService.java:192)
>         at org.apache.webbeans.servlet.WebBeansConfigurationListener.requestDestroyed(WebBeansConfigurationListener.java:135)

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see: http://www.atlassian.com/software/jira