openwebbeans-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Gurkan Erdogdu (JIRA)" <j...@apache.org>
Subject [jira] [Commented] (OWB-556) bean with interceptor + @PreDestroy causes a NullPointerException
Date Thu, 07 Apr 2011 16:58:06 GMT

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

Gurkan Erdogdu commented on OWB-556:
------------------------------------

yeah, I also know where the problem may occur, because I wrote it :)  Sample application is
always good idea to have 

> 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: Gurkan Erdogdu
>
> 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.
For more information on JIRA, see: http://www.atlassian.com/software/jira

Mime
View raw message