You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@openwebbeans.apache.org by "Gerhard Petracek (JIRA)" <ji...@apache.org> on 2011/03/30 00:43:06 UTC

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

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

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

Posted by "Mark Struberg (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/OWB-556?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13017087#comment-13017087 ] 

Mark Struberg commented on OWB-556:
-----------------------------------

heh of course ;) Good to have you back and finding the time working on this! Just be prepared: Joe and I fixed a few bugs in this area recently and streamlined the code. We are now thread safe and 3 times faster. But I'm not sure if this had a sideffect (closing one door, opening another one...)
If you are changing the CreationalContext stuff then please locally increment the threads and invocation count of the IntercepterPerformanceTest. We must make sure that we don't re-introduce concurrency problems again.

LieGrue,
strub

> 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

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

Posted by "Gurkan Erdogdu (JIRA)" <ji...@apache.org>.
    [ 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

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

Posted by "Mark Struberg (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/OWB-556?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Mark Struberg updated OWB-556:
------------------------------

    Fix Version/s:     (was: 1.1.1)
                   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: Gurkan Erdogdu
>             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.
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

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

Posted by "Mark Struberg (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/OWB-556?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13016764#comment-13016764 ] 

Mark Struberg commented on OWB-556:
-----------------------------------

hi! I think I know where the problem is, but I have a conference next week and I'm 180% overloaded.
Will fix it end of next week.

> 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

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

Posted by "Gurkan Erdogdu (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/OWB-556?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13016722#comment-13016722 ] 

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

Please attach sample application or test that shows the problem. 

> 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