[
https://issues.apache.org/jira/browse/OWB-354?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12857066#action_12857066
]
Joe Bergmark commented on OWB-354:
----------------------------------
I was thinking some more about this today.
It seems like there is no need for these variables in the WebContextService to
be static at all. Please correct me if I am wrong, but the ContextService is
already looked up via the WebBeansFinder, so we will already have one per
classloader (which presumably means one per application). If the goal is to
share things inside of an app, we already get that behavior by having them as
instance variables. The threadlocals will prevent us from sharing those
particular contexts between different threads in the same app.
It seems a simple solution would be to simply make all of the static variables
instance variables, unless there is something we really need to share between
applications. I can't come up with anything in my review.
> WebContextService may throw NPE in tiered classloading environmemt
> ------------------------------------------------------------------
>
> Key: OWB-354
> URL: https://issues.apache.org/jira/browse/OWB-354
> Project: OpenWebBeans
> Issue Type: Bug
> Components: Context and Scopes
> Affects Versions: M4
> Reporter: Joe Bergmark
> Assignee: Joe Bergmark
> Fix For: 1.0.0
>
>
> WebContextService sets the static context variables (which are ThreadLocals)
> to null during a call to destroy. For example requestContext.
> In a classloading environment where the same WebContextService would be
> shared between webapps, this could lead to a NullPointerException in another
> application as the static variable has been set to null and that static would
> be shared.
--
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators:
https://issues.apache.org/jira/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira