You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@openwebbeans.apache.org by "YING WANG (JIRA)" <ji...@apache.org> on 2010/05/07 05:04:48 UTC
[jira] Created: (OWB-369) Static ContextsService in ContextFactory
causes wrong webContextService used for multiple applications
Static ContextsService in ContextFactory causes wrong webContextService used for multiple applications
------------------------------------------------------------------------------------------------------
Key: OWB-369
URL: https://issues.apache.org/jira/browse/OWB-369
Project: OpenWebBeans
Issue Type: Bug
Affects Versions: M4
Reporter: YING WANG
Assignee: YING WANG
Fix For: 1.0.0
To reproduce,
Application A, which does not support conversation, installed and tested without any issue. then stop and uninstalled.
Application B, which support conversation, get installed and started.
When test Application B, ApplicationA's contextService is used and causes conversation scope is not found since it does not support conversation.
The problem is because of static variable used for contextsService in ContextFactory which is JVM-wide and only init once. While supportConversation flag is application-wide property.
Probably we need contextService variable to be classloader based instead of static variable. or need some change to supportsConversation flag.
--
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.
Re: [jira] Commented: (OWB-369) Static ContextsService in
ContextFactory causes wrong webContextService used for multiple applications
Posted by Joseph Bergmark <be...@apache.org>.
Perhaps it would be more clear if detailed what I think is happening in this
particular example:
1) WebBeansFinder loads a single WebContextService per application (happens
during the Lifecycle init).
2) WebContextService calls "ConversationManager.getInstance();", which would
use the WebBeansFinder to load a single ConversationManager per class.
However, it then stores the result away in a static variable.
Once that ConversationManager is in a static variable of the WebBeansFinder,
its going to get used for ALL instances of the WebContextService, even
though each application will have its own instance.
Sincerely,
Joe
On Fri, May 7, 2010 at 10:54 AM, Joseph Bergmark <be...@apache.org>wrote:
> I'm not sure I understand the point you are trying to make here Gurkan.
> Are you saying you do not want to make changes that will allow OpenWebBeans
> to work in tiered classloading environments? This isn't the first time an
> issue like that has come up, and we have made several changes already.
>
> As we already have requests to publish the build artifacts as OSGi bundles,
> so there are people attempting to use OWB in exactly this way.
>
> In this case it is probably a very simple fix. The code just has to treat
> static variables as something that gets shared between applications, and
> instance variables as things that get shared within an application.
> WebBeansFinder already provides a way of loading one instance of a class per
> classloader, so you get the "one per app" level of loading already. I'm not
> sure what the additional value we are getting from static variables in
> WebContextService (as an example).
>
> From my perspective, I don't think we can expect every consumer of OWB to
> be bundling the jars inside of their application.
>
> Sincerely,
>
> Joe
>
>
> On Fri, May 7, 2010 at 10:02 AM, Gurkan Erdogdu (JIRA) <ji...@apache.org>wrote:
>
>>
>> [
>> https://issues.apache.org/jira/browse/OWB-369?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12865159#action_12865159]
>>
>> Gurkan Erdogdu commented on OWB-369:
>> ------------------------------------
>>
>> Joe,
>>
>> As I said OWB not written for tiered-class loaders. So all of the loaded
>> classes must be loaded by each web application classloaders therefore does
>> not collide with each other.
>>
>> For example: Each web application has its own webbeans-finder class and
>> different ConversationManager.
>>
>> > Static ContextsService in ContextFactory causes wrong webContextService
>> used for multiple applications
>> >
>> ------------------------------------------------------------------------------------------------------
>> >
>> > Key: OWB-369
>> > URL: https://issues.apache.org/jira/browse/OWB-369
>> > Project: OpenWebBeans
>> > Issue Type: Bug
>> > Affects Versions: M4
>> > Reporter: YING WANG
>> > Assignee: YING WANG
>> > Fix For: 1.0.0
>> >
>> >
>> > To reproduce,
>> > Application A, which does not support conversation, installed and tested
>> without any issue. then stop and uninstalled.
>> > Application B, which support conversation, get installed and started.
>> > When test Application B, ApplicationA's contextService is used and
>> causes conversation scope is not found since it does not support
>> conversation.
>> > The problem is because of static variable used for contextsService in
>> ContextFactory which is JVM-wide and only init once. While
>> supportConversation flag is application-wide property.
>> > Probably we need contextService variable to be classloader based
>> instead of static variable. or need some change to supportsConversation
>> flag.
>>
>> --
>> This message is automatically generated by JIRA.
>> -
>> You can reply to this email to add a comment to the issue online.
>>
>>
>
Re: [jira] Commented: (OWB-369) Static ContextsService in
ContextFactory causes wrong webContextService used for multiple applications
Posted by Joseph Bergmark <be...@apache.org>.
I'm not sure I understand the point you are trying to make here Gurkan. Are
you saying you do not want to make changes that will allow OpenWebBeans to
work in tiered classloading environments? This isn't the first time an
issue like that has come up, and we have made several changes already.
As we already have requests to publish the build artifacts as OSGi bundles,
so there are people attempting to use OWB in exactly this way.
In this case it is probably a very simple fix. The code just has to treat
static variables as something that gets shared between applications, and
instance variables as things that get shared within an application.
WebBeansFinder already provides a way of loading one instance of a class per
classloader, so you get the "one per app" level of loading already. I'm not
sure what the additional value we are getting from static variables in
WebContextService (as an example).
>From my perspective, I don't think we can expect every consumer of OWB to be
bundling the jars inside of their application.
Sincerely,
Joe
On Fri, May 7, 2010 at 10:02 AM, Gurkan Erdogdu (JIRA) <ji...@apache.org>wrote:
>
> [
> https://issues.apache.org/jira/browse/OWB-369?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12865159#action_12865159]
>
> Gurkan Erdogdu commented on OWB-369:
> ------------------------------------
>
> Joe,
>
> As I said OWB not written for tiered-class loaders. So all of the loaded
> classes must be loaded by each web application classloaders therefore does
> not collide with each other.
>
> For example: Each web application has its own webbeans-finder class and
> different ConversationManager.
>
> > Static ContextsService in ContextFactory causes wrong webContextService
> used for multiple applications
> >
> ------------------------------------------------------------------------------------------------------
> >
> > Key: OWB-369
> > URL: https://issues.apache.org/jira/browse/OWB-369
> > Project: OpenWebBeans
> > Issue Type: Bug
> > Affects Versions: M4
> > Reporter: YING WANG
> > Assignee: YING WANG
> > Fix For: 1.0.0
> >
> >
> > To reproduce,
> > Application A, which does not support conversation, installed and tested
> without any issue. then stop and uninstalled.
> > Application B, which support conversation, get installed and started.
> > When test Application B, ApplicationA's contextService is used and causes
> conversation scope is not found since it does not support conversation.
> > The problem is because of static variable used for contextsService in
> ContextFactory which is JVM-wide and only init once. While
> supportConversation flag is application-wide property.
> > Probably we need contextService variable to be classloader based
> instead of static variable. or need some change to supportsConversation
> flag.
>
> --
> This message is automatically generated by JIRA.
> -
> You can reply to this email to add a comment to the issue online.
>
>
[jira] Reopened: (OWB-369) Static ContextsService in ContextFactory
causes wrong webContextService used for multiple applications
Posted by "Mark Struberg (JIRA)" <ji...@apache.org>.
[ https://issues.apache.org/jira/browse/OWB-369?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]
Mark Struberg reopened OWB-369:
-------------------------------
Assignee: Mark Struberg (was: YING WANG)
Due to this change, the cost of getting the ContextsService each time is pretty high.
I will further improve this by maintaining a Map to cache the ContextsService depending on the ClassLoader which is being used.
> Static ContextsService in ContextFactory causes wrong webContextService used for multiple applications
> ------------------------------------------------------------------------------------------------------
>
> Key: OWB-369
> URL: https://issues.apache.org/jira/browse/OWB-369
> Project: OpenWebBeans
> Issue Type: Bug
> Affects Versions: M4
> Reporter: YING WANG
> Assignee: Mark Struberg
> Fix For: 1.0.0-CR1
>
> Attachments: ContextFactory.patch
>
>
> To reproduce,
> Application A, which does not support conversation, installed and tested without any issue. then stop and uninstalled.
> Application B, which support conversation, get installed and started.
> When test Application B, ApplicationA's contextService is used and causes conversation scope is not found since it does not support conversation.
> The problem is because of static variable used for contextsService in ContextFactory which is JVM-wide and only init once. While supportConversation flag is application-wide property.
> Probably we need contextService variable to be classloader based instead of static variable. or need some change to supportsConversation flag.
--
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.
[jira] Closed: (OWB-369) Static ContextsService in ContextFactory
causes wrong webContextService used for multiple applications
Posted by "Gurkan Erdogdu (JIRA)" <ji...@apache.org>.
[ https://issues.apache.org/jira/browse/OWB-369?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]
Gurkan Erdogdu closed OWB-369.
------------------------------
Assignee: Gurkan Erdogdu (was: YING WANG)
Resolution: Fixed
Thanks YING, I did commit.
> Static ContextsService in ContextFactory causes wrong webContextService used for multiple applications
> ------------------------------------------------------------------------------------------------------
>
> Key: OWB-369
> URL: https://issues.apache.org/jira/browse/OWB-369
> Project: OpenWebBeans
> Issue Type: Bug
> Affects Versions: M4
> Reporter: YING WANG
> Assignee: Gurkan Erdogdu
> Fix For: 1.0.0
>
> Attachments: ContextFactory.patch
>
>
> To reproduce,
> Application A, which does not support conversation, installed and tested without any issue. then stop and uninstalled.
> Application B, which support conversation, get installed and started.
> When test Application B, ApplicationA's contextService is used and causes conversation scope is not found since it does not support conversation.
> The problem is because of static variable used for contextsService in ContextFactory which is JVM-wide and only init once. While supportConversation flag is application-wide property.
> Probably we need contextService variable to be classloader based instead of static variable. or need some change to supportsConversation flag.
--
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.
[jira] Reopened: (OWB-369) Static ContextsService in ContextFactory
causes wrong webContextService used for multiple applications
Posted by "YING WANG (JIRA)" <ji...@apache.org>.
[ https://issues.apache.org/jira/browse/OWB-369?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]
YING WANG reopened OWB-369:
---------------------------
Assignee: YING WANG (was: Gurkan Erdogdu)
Still randomly see different conversationManagers invoked for same session. Add 2 more changes.
> Static ContextsService in ContextFactory causes wrong webContextService used for multiple applications
> ------------------------------------------------------------------------------------------------------
>
> Key: OWB-369
> URL: https://issues.apache.org/jira/browse/OWB-369
> Project: OpenWebBeans
> Issue Type: Bug
> Affects Versions: M4
> Reporter: YING WANG
> Assignee: YING WANG
> Fix For: 1.0.0
>
> Attachments: ContextFactory.patch
>
>
> To reproduce,
> Application A, which does not support conversation, installed and tested without any issue. then stop and uninstalled.
> Application B, which support conversation, get installed and started.
> When test Application B, ApplicationA's contextService is used and causes conversation scope is not found since it does not support conversation.
> The problem is because of static variable used for contextsService in ContextFactory which is JVM-wide and only init once. While supportConversation flag is application-wide property.
> Probably we need contextService variable to be classloader based instead of static variable. or need some change to supportsConversation flag.
--
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.
[jira] Closed: (OWB-369) Static ContextsService in ContextFactory
causes wrong webContextService used for multiple applications
Posted by "YING WANG (JIRA)" <ji...@apache.org>.
[ https://issues.apache.org/jira/browse/OWB-369?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]
YING WANG closed OWB-369.
-------------------------
Resolution: Fixed
> Static ContextsService in ContextFactory causes wrong webContextService used for multiple applications
> ------------------------------------------------------------------------------------------------------
>
> Key: OWB-369
> URL: https://issues.apache.org/jira/browse/OWB-369
> Project: OpenWebBeans
> Issue Type: Bug
> Affects Versions: M4
> Reporter: YING WANG
> Assignee: YING WANG
> Fix For: 1.0.0
>
> Attachments: ContextFactory.patch
>
>
> To reproduce,
> Application A, which does not support conversation, installed and tested without any issue. then stop and uninstalled.
> Application B, which support conversation, get installed and started.
> When test Application B, ApplicationA's contextService is used and causes conversation scope is not found since it does not support conversation.
> The problem is because of static variable used for contextsService in ContextFactory which is JVM-wide and only init once. While supportConversation flag is application-wide property.
> Probably we need contextService variable to be classloader based instead of static variable. or need some change to supportsConversation flag.
--
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.
[jira] Commented: (OWB-369) Static ContextsService in
ContextFactory causes wrong webContextService used for multiple
applications
Posted by "Gurkan Erdogdu (JIRA)" <ji...@apache.org>.
[ https://issues.apache.org/jira/browse/OWB-369?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12865307#action_12865307 ]
Gurkan Erdogdu commented on OWB-369:
------------------------------------
I have changed WebBeansFinder Map<String,Map<ClassLoader,Object>> to Map<ClassLoader,Map<String,Object>>. Also remove statics.
> Static ContextsService in ContextFactory causes wrong webContextService used for multiple applications
> ------------------------------------------------------------------------------------------------------
>
> Key: OWB-369
> URL: https://issues.apache.org/jira/browse/OWB-369
> Project: OpenWebBeans
> Issue Type: Bug
> Affects Versions: M4
> Reporter: YING WANG
> Assignee: YING WANG
> Fix For: 1.0.0
>
>
> To reproduce,
> Application A, which does not support conversation, installed and tested without any issue. then stop and uninstalled.
> Application B, which support conversation, get installed and started.
> When test Application B, ApplicationA's contextService is used and causes conversation scope is not found since it does not support conversation.
> The problem is because of static variable used for contextsService in ContextFactory which is JVM-wide and only init once. While supportConversation flag is application-wide property.
> Probably we need contextService variable to be classloader based instead of static variable. or need some change to supportsConversation flag.
--
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.
[jira] Commented: (OWB-369) Static ContextsService in
ContextFactory causes wrong webContextService used for multiple
applications
Posted by "Mark Struberg (JIRA)" <ji...@apache.org>.
[ https://issues.apache.org/jira/browse/OWB-369?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12865142#action_12865142 ]
Mark Struberg commented on OWB-369:
-----------------------------------
Imo ConversationManager should also get refactored to be picked up with WebBeansFinder rather than using static methods on it.
> Static ContextsService in ContextFactory causes wrong webContextService used for multiple applications
> ------------------------------------------------------------------------------------------------------
>
> Key: OWB-369
> URL: https://issues.apache.org/jira/browse/OWB-369
> Project: OpenWebBeans
> Issue Type: Bug
> Affects Versions: M4
> Reporter: YING WANG
> Assignee: YING WANG
> Fix For: 1.0.0
>
>
> To reproduce,
> Application A, which does not support conversation, installed and tested without any issue. then stop and uninstalled.
> Application B, which support conversation, get installed and started.
> When test Application B, ApplicationA's contextService is used and causes conversation scope is not found since it does not support conversation.
> The problem is because of static variable used for contextsService in ContextFactory which is JVM-wide and only init once. While supportConversation flag is application-wide property.
> Probably we need contextService variable to be classloader based instead of static variable. or need some change to supportsConversation flag.
--
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.
[jira] Commented: (OWB-369) Static ContextsService in
ContextFactory causes wrong webContextService used for multiple
applications
Posted by "Gurkan Erdogdu (JIRA)" <ji...@apache.org>.
[ https://issues.apache.org/jira/browse/OWB-369?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12865159#action_12865159 ]
Gurkan Erdogdu commented on OWB-369:
------------------------------------
Joe,
As I said OWB not written for tiered-class loaders. So all of the loaded classes must be loaded by each web application classloaders therefore does not collide with each other.
For example: Each web application has its own webbeans-finder class and different ConversationManager.
> Static ContextsService in ContextFactory causes wrong webContextService used for multiple applications
> ------------------------------------------------------------------------------------------------------
>
> Key: OWB-369
> URL: https://issues.apache.org/jira/browse/OWB-369
> Project: OpenWebBeans
> Issue Type: Bug
> Affects Versions: M4
> Reporter: YING WANG
> Assignee: YING WANG
> Fix For: 1.0.0
>
>
> To reproduce,
> Application A, which does not support conversation, installed and tested without any issue. then stop and uninstalled.
> Application B, which support conversation, get installed and started.
> When test Application B, ApplicationA's contextService is used and causes conversation scope is not found since it does not support conversation.
> The problem is because of static variable used for contextsService in ContextFactory which is JVM-wide and only init once. While supportConversation flag is application-wide property.
> Probably we need contextService variable to be classloader based instead of static variable. or need some change to supportsConversation flag.
--
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.
[jira] Commented: (OWB-369) Static ContextsService in
ContextFactory causes wrong webContextService used for multiple
applications
Posted by "Gurkan Erdogdu (JIRA)" <ji...@apache.org>.
[ https://issues.apache.org/jira/browse/OWB-369?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12865043#action_12865043 ]
Gurkan Erdogdu commented on OWB-369:
------------------------------------
OpenWebBeans libraries must not be on the global class loaders (global class path), it has not written to work like this. Only spi and api modules could be on the global class path of the container.
> Static ContextsService in ContextFactory causes wrong webContextService used for multiple applications
> ------------------------------------------------------------------------------------------------------
>
> Key: OWB-369
> URL: https://issues.apache.org/jira/browse/OWB-369
> Project: OpenWebBeans
> Issue Type: Bug
> Affects Versions: M4
> Reporter: YING WANG
> Assignee: YING WANG
> Fix For: 1.0.0
>
>
> To reproduce,
> Application A, which does not support conversation, installed and tested without any issue. then stop and uninstalled.
> Application B, which support conversation, get installed and started.
> When test Application B, ApplicationA's contextService is used and causes conversation scope is not found since it does not support conversation.
> The problem is because of static variable used for contextsService in ContextFactory which is JVM-wide and only init once. While supportConversation flag is application-wide property.
> Probably we need contextService variable to be classloader based instead of static variable. or need some change to supportsConversation flag.
--
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.
[jira] Updated: (OWB-369) Static ContextsService in ContextFactory
causes wrong webContextService used for multiple applications
Posted by "YING WANG (JIRA)" <ji...@apache.org>.
[ https://issues.apache.org/jira/browse/OWB-369?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]
YING WANG updated OWB-369:
--------------------------
Attachment: ContextFactory.patch
Thanks Gurkan, Joe. With Gurkan's recent changes, my second app still fails. How are we going to handle static ContextService in ContextFactory? I have uploaded this patch to replace it with local variables in the class. It might not be optimized, but requires minimum code changes. Please help review. Thanks in advance.
> Static ContextsService in ContextFactory causes wrong webContextService used for multiple applications
> ------------------------------------------------------------------------------------------------------
>
> Key: OWB-369
> URL: https://issues.apache.org/jira/browse/OWB-369
> Project: OpenWebBeans
> Issue Type: Bug
> Affects Versions: M4
> Reporter: YING WANG
> Assignee: YING WANG
> Fix For: 1.0.0
>
> Attachments: ContextFactory.patch
>
>
> To reproduce,
> Application A, which does not support conversation, installed and tested without any issue. then stop and uninstalled.
> Application B, which support conversation, get installed and started.
> When test Application B, ApplicationA's contextService is used and causes conversation scope is not found since it does not support conversation.
> The problem is because of static variable used for contextsService in ContextFactory which is JVM-wide and only init once. While supportConversation flag is application-wide property.
> Probably we need contextService variable to be classloader based instead of static variable. or need some change to supportsConversation flag.
--
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.
[jira] Commented: (OWB-369) Static ContextsService in
ContextFactory causes wrong webContextService used for multiple
applications
Posted by "Gurkan Erdogdu (JIRA)" <ji...@apache.org>.
[ https://issues.apache.org/jira/browse/OWB-369?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12865039#action_12865039 ]
Gurkan Erdogdu commented on OWB-369:
------------------------------------
ContextFactory must be loaded by web application class loader, i.e each application must own their own ContextFactory class, so there must not be any problem
> Static ContextsService in ContextFactory causes wrong webContextService used for multiple applications
> ------------------------------------------------------------------------------------------------------
>
> Key: OWB-369
> URL: https://issues.apache.org/jira/browse/OWB-369
> Project: OpenWebBeans
> Issue Type: Bug
> Affects Versions: M4
> Reporter: YING WANG
> Assignee: YING WANG
> Fix For: 1.0.0
>
>
> To reproduce,
> Application A, which does not support conversation, installed and tested without any issue. then stop and uninstalled.
> Application B, which support conversation, get installed and started.
> When test Application B, ApplicationA's contextService is used and causes conversation scope is not found since it does not support conversation.
> The problem is because of static variable used for contextsService in ContextFactory which is JVM-wide and only init once. While supportConversation flag is application-wide property.
> Probably we need contextService variable to be classloader based instead of static variable. or need some change to supportsConversation flag.
--
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.
[jira] Resolved: (OWB-369) Static ContextsService in ContextFactory
causes wrong webContextService used for multiple applications
Posted by "Mark Struberg (JIRA)" <ji...@apache.org>.
[ https://issues.apache.org/jira/browse/OWB-369?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]
Mark Struberg resolved OWB-369.
-------------------------------
Resolution: Fixed
> Static ContextsService in ContextFactory causes wrong webContextService used for multiple applications
> ------------------------------------------------------------------------------------------------------
>
> Key: OWB-369
> URL: https://issues.apache.org/jira/browse/OWB-369
> Project: OpenWebBeans
> Issue Type: Bug
> Affects Versions: M4
> Reporter: YING WANG
> Assignee: Mark Struberg
> Fix For: 1.0.0-CR1
>
> Attachments: ContextFactory.patch
>
>
> To reproduce,
> Application A, which does not support conversation, installed and tested without any issue. then stop and uninstalled.
> Application B, which support conversation, get installed and started.
> When test Application B, ApplicationA's contextService is used and causes conversation scope is not found since it does not support conversation.
> The problem is because of static variable used for contextsService in ContextFactory which is JVM-wide and only init once. While supportConversation flag is application-wide property.
> Probably we need contextService variable to be classloader based instead of static variable. or need some change to supportsConversation flag.
--
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.
[jira] Commented: (OWB-369) Static ContextsService in
ContextFactory causes wrong webContextService used for multiple
applications
Posted by "Joe Bergmark (JIRA)" <ji...@apache.org>.
[ https://issues.apache.org/jira/browse/OWB-369?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12865138#action_12865138 ]
Joe Bergmark commented on OWB-369:
----------------------------------
Gurkan, I believe this comes down to another case of tiered classloading environments.
Given the way that WebBeansFinder load the ContextService, you are going to have a unique instance of the ContextService per Web App (assuming each web app has a unique classloader). However, I think the concern is the static variables are going to be shared across instances. Similar to the problem we have had earlier with setting static variables to null leading to NPEs in other applications.
In this case the ConversationManager is static and therefore shared between all instances of ContextService. If there is any initialization done in that Manager that could be different for different apps then we likely have a problem.
> Static ContextsService in ContextFactory causes wrong webContextService used for multiple applications
> ------------------------------------------------------------------------------------------------------
>
> Key: OWB-369
> URL: https://issues.apache.org/jira/browse/OWB-369
> Project: OpenWebBeans
> Issue Type: Bug
> Affects Versions: M4
> Reporter: YING WANG
> Assignee: YING WANG
> Fix For: 1.0.0
>
>
> To reproduce,
> Application A, which does not support conversation, installed and tested without any issue. then stop and uninstalled.
> Application B, which support conversation, get installed and started.
> When test Application B, ApplicationA's contextService is used and causes conversation scope is not found since it does not support conversation.
> The problem is because of static variable used for contextsService in ContextFactory which is JVM-wide and only init once. While supportConversation flag is application-wide property.
> Probably we need contextService variable to be classloader based instead of static variable. or need some change to supportsConversation flag.
--
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.
[jira] Reopened: (OWB-369) Static ContextsService in ContextFactory
causes wrong webContextService used for multiple applications
Posted by "Mark Struberg (JIRA)" <ji...@apache.org>.
[ https://issues.apache.org/jira/browse/OWB-369?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]
Mark Struberg reopened OWB-369:
-------------------------------
hint from Gurkan;
> When the application is removed, you have to remove also from
> ContextFactory cache othewise create a leak
> Static ContextsService in ContextFactory causes wrong webContextService used for multiple applications
> ------------------------------------------------------------------------------------------------------
>
> Key: OWB-369
> URL: https://issues.apache.org/jira/browse/OWB-369
> Project: OpenWebBeans
> Issue Type: Bug
> Affects Versions: M4
> Reporter: YING WANG
> Assignee: Mark Struberg
> Fix For: 1.0.0-CR1
>
> Attachments: ContextFactory.patch
>
>
> To reproduce,
> Application A, which does not support conversation, installed and tested without any issue. then stop and uninstalled.
> Application B, which support conversation, get installed and started.
> When test Application B, ApplicationA's contextService is used and causes conversation scope is not found since it does not support conversation.
> The problem is because of static variable used for contextsService in ContextFactory which is JVM-wide and only init once. While supportConversation flag is application-wide property.
> Probably we need contextService variable to be classloader based instead of static variable. or need some change to supportsConversation flag.
--
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.
[jira] Closed: (OWB-369) Static ContextsService in ContextFactory
causes wrong webContextService used for multiple applications
Posted by "Gurkan Erdogdu (JIRA)" <ji...@apache.org>.
[ https://issues.apache.org/jira/browse/OWB-369?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]
Gurkan Erdogdu closed OWB-369.
------------------------------
Resolution: Fixed
> Static ContextsService in ContextFactory causes wrong webContextService used for multiple applications
> ------------------------------------------------------------------------------------------------------
>
> Key: OWB-369
> URL: https://issues.apache.org/jira/browse/OWB-369
> Project: OpenWebBeans
> Issue Type: Bug
> Affects Versions: M4
> Reporter: YING WANG
> Assignee: Mark Struberg
> Fix For: 1.0.0-CR1
>
> Attachments: ContextFactory.patch
>
>
> To reproduce,
> Application A, which does not support conversation, installed and tested without any issue. then stop and uninstalled.
> Application B, which support conversation, get installed and started.
> When test Application B, ApplicationA's contextService is used and causes conversation scope is not found since it does not support conversation.
> The problem is because of static variable used for contextsService in ContextFactory which is JVM-wide and only init once. While supportConversation flag is application-wide property.
> Probably we need contextService variable to be classloader based instead of static variable. or need some change to supportsConversation flag.
--
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.