You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@myfaces.apache.org by "Thomas Spiegl (JIRA)" <de...@myfaces.apache.org> on 2008/01/08 17:01:56 UTC
[jira] Created: (ORCHESTRA-14) ConversationManagerSessionListener
leak & IllegalStateException
ConversationManagerSessionListener leak & IllegalStateException
---------------------------------------------------------------
Key: ORCHESTRA-14
URL: https://issues.apache.org/jira/browse/ORCHESTRA-14
Project: MyFaces Orchestra
Issue Type: Bug
Components: Conversation
Affects Versions: 1.1
Environment: tomcat 5
Reporter: Thomas Spiegl
Assignee: Thomas Spiegl
ConversationManagerSessionListener has serveral issues:
1) attributeReplaced sets the old instance of conversationManager in conversationWiperThread instead of the new one
2) on session expire ConversationManagerSessionListener.attributeRemoved is getting called and session.getId() throws IllegalStateException
3) ConversationManagerSessionListener.sessionDestroyed will throw a IllegalStateException as well -> method is useless
Solution:
1) use a unique id for conversationManager instead of session.getId() as a key in conversationWiperThread
2) remove HttpSessionListener interface from ConversationManagerSessionListener
--
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.
[jira] Commented: (ORCHESTRA-14) ConversationManagerSessionListener
leak & IllegalStateException
Posted by "Simon Kitching (JIRA)" <de...@myfaces.apache.org>.
[ https://issues.apache.org/jira/browse/ORCHESTRA-14?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12557582#action_12557582 ]
Simon Kitching commented on ORCHESTRA-14:
-----------------------------------------
Hmm..still works for me in Tomcat 5.5.25 as well.
I enhanced ConversationContextSessionListener.removeAttribute as follows:
public void attributeRemoved(HttpSessionBindingEvent event)
{
log.fatal("Removing attribute " + event.getName());
try {
HttpSession session = event.getSession();
session.getId();
log.fatal("IllegalStateException not thrown in attributeRemoved");
} catch(IllegalStateException e) {
log.fatal("IllegalStateException thrown in attributeRemoved");
}
....
And in all the three tested cases (tomcat 5.5.25, tomcat 6.0.15, jetty 6.1.1) I get this:
10.01.2008 10:32:42 org.apache.myfaces.orchestra.conversation.servlet.ConversationManagerSessionListener attributeRemoved
SCHWERWIEGEND: Removing attribute jsf_sequence
10.01.2008 10:32:42 org.apache.myfaces.orchestra.conversation.servlet.ConversationManagerSessionListener attributeRemoved
SCHWERWIEGEND: IllegalStateException not thrown in attributeRemoved
10.01.2008 10:32:42 org.apache.myfaces.orchestra.conversation.servlet.ConversationManagerSessionListener attributeRemoved
SCHWERWIEGEND: Removing attribute org.apache.myfaces.ConversationManager
10.01.2008 10:32:42 org.apache.myfaces.orchestra.conversation.servlet.ConversationManagerSessionListener attributeRemoved
SCHWERWIEGEND: IllegalStateException not thrown in attributeRemoved
Thomas, do you have any idea why you might be seeing problems with session.getId() when I am not?
> ConversationManagerSessionListener leak & IllegalStateException
> ---------------------------------------------------------------
>
> Key: ORCHESTRA-14
> URL: https://issues.apache.org/jira/browse/ORCHESTRA-14
> Project: MyFaces Orchestra
> Issue Type: Bug
> Components: Conversation
> Affects Versions: 1.1
> Environment: tomcat 5
> Reporter: Thomas Spiegl
> Assignee: Thomas Spiegl
> Fix For: 1.1
>
>
> ConversationManagerSessionListener has serveral issues:
> 1) attributeReplaced sets the old instance of conversationManager in conversationWiperThread instead of the new one
> 2) on session expire ConversationManagerSessionListener.attributeRemoved is getting called and session.getId() throws IllegalStateException
> 3) ConversationManagerSessionListener.sessionDestroyed will throw a IllegalStateException as well -> method is useless
> Solution:
> 1) use a unique id for conversationManager instead of session.getId() as a key in conversationWiperThread
> 2) remove HttpSessionListener interface from ConversationManagerSessionListener
--
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.
[jira] Commented: (ORCHESTRA-14) ConversationManagerSessionListener
leak & IllegalStateException
Posted by "Simon Kitching (JIRA)" <de...@myfaces.apache.org>.
[ https://issues.apache.org/jira/browse/ORCHESTRA-14?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12557575#action_12557575 ]
Simon Kitching commented on ORCHESTRA-14:
-----------------------------------------
Thomas, which servlet container are you using?
I have tested both Jetty and Tomcat 6.0 and neither throws an IllegalStateException when session.getId() is called from the attributeRemoved method while removing attributes from an expired session. The javadocs for the HttpSession class don't say anything either way about whether it is valid to call getId on an invalidated session or not.
Point (1) indeed looks right. Good catch..
> ConversationManagerSessionListener leak & IllegalStateException
> ---------------------------------------------------------------
>
> Key: ORCHESTRA-14
> URL: https://issues.apache.org/jira/browse/ORCHESTRA-14
> Project: MyFaces Orchestra
> Issue Type: Bug
> Components: Conversation
> Affects Versions: 1.1
> Environment: tomcat 5
> Reporter: Thomas Spiegl
> Assignee: Thomas Spiegl
> Fix For: 1.1
>
>
> ConversationManagerSessionListener has serveral issues:
> 1) attributeReplaced sets the old instance of conversationManager in conversationWiperThread instead of the new one
> 2) on session expire ConversationManagerSessionListener.attributeRemoved is getting called and session.getId() throws IllegalStateException
> 3) ConversationManagerSessionListener.sessionDestroyed will throw a IllegalStateException as well -> method is useless
> Solution:
> 1) use a unique id for conversationManager instead of session.getId() as a key in conversationWiperThread
> 2) remove HttpSessionListener interface from ConversationManagerSessionListener
--
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.
[jira] Commented: (ORCHESTRA-14) ConversationManagerSessionListener
leak & IllegalStateException
Posted by "Simon Kitching (JIRA)" <de...@myfaces.apache.org>.
[ https://issues.apache.org/jira/browse/ORCHESTRA-14?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12557577#action_12557577 ]
Simon Kitching commented on ORCHESTRA-14:
-----------------------------------------
Doh..I see you've put "tomcat5" in the environment section of this bug. I'll try testing that.
> ConversationManagerSessionListener leak & IllegalStateException
> ---------------------------------------------------------------
>
> Key: ORCHESTRA-14
> URL: https://issues.apache.org/jira/browse/ORCHESTRA-14
> Project: MyFaces Orchestra
> Issue Type: Bug
> Components: Conversation
> Affects Versions: 1.1
> Environment: tomcat 5
> Reporter: Thomas Spiegl
> Assignee: Thomas Spiegl
> Fix For: 1.1
>
>
> ConversationManagerSessionListener has serveral issues:
> 1) attributeReplaced sets the old instance of conversationManager in conversationWiperThread instead of the new one
> 2) on session expire ConversationManagerSessionListener.attributeRemoved is getting called and session.getId() throws IllegalStateException
> 3) ConversationManagerSessionListener.sessionDestroyed will throw a IllegalStateException as well -> method is useless
> Solution:
> 1) use a unique id for conversationManager instead of session.getId() as a key in conversationWiperThread
> 2) remove HttpSessionListener interface from ConversationManagerSessionListener
--
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.
[jira] Resolved: (ORCHESTRA-14) ConversationManagerSessionListener
leak & IllegalStateException
Posted by "Thomas Spiegl (JIRA)" <de...@myfaces.apache.org>.
[ https://issues.apache.org/jira/browse/ORCHESTRA-14?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]
Thomas Spiegl resolved ORCHESTRA-14.
------------------------------------
Resolution: Fixed
Fix Version/s: 1.1
resolved
> ConversationManagerSessionListener leak & IllegalStateException
> ---------------------------------------------------------------
>
> Key: ORCHESTRA-14
> URL: https://issues.apache.org/jira/browse/ORCHESTRA-14
> Project: MyFaces Orchestra
> Issue Type: Bug
> Components: Conversation
> Affects Versions: 1.1
> Environment: tomcat 5
> Reporter: Thomas Spiegl
> Assignee: Thomas Spiegl
> Fix For: 1.1
>
>
> ConversationManagerSessionListener has serveral issues:
> 1) attributeReplaced sets the old instance of conversationManager in conversationWiperThread instead of the new one
> 2) on session expire ConversationManagerSessionListener.attributeRemoved is getting called and session.getId() throws IllegalStateException
> 3) ConversationManagerSessionListener.sessionDestroyed will throw a IllegalStateException as well -> method is useless
> Solution:
> 1) use a unique id for conversationManager instead of session.getId() as a key in conversationWiperThread
> 2) remove HttpSessionListener interface from ConversationManagerSessionListener
--
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.
[jira] Commented: (ORCHESTRA-14) ConversationManagerSessionListener
leak & IllegalStateException
Posted by "Simon Kitching (JIRA)" <de...@myfaces.apache.org>.
[ https://issues.apache.org/jira/browse/ORCHESTRA-14?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12557584#action_12557584 ]
Simon Kitching commented on ORCHESTRA-14:
-----------------------------------------
Sorry, just to be clear: the attributeRemove calls above are being triggered by a session timeout. I set the session timeout to 3 minutes, visited a few pages then waited. As expected, 3 minutes later there is a sequence of calls to attributeRemoved, one for each attribute in the session.
> ConversationManagerSessionListener leak & IllegalStateException
> ---------------------------------------------------------------
>
> Key: ORCHESTRA-14
> URL: https://issues.apache.org/jira/browse/ORCHESTRA-14
> Project: MyFaces Orchestra
> Issue Type: Bug
> Components: Conversation
> Affects Versions: 1.1
> Environment: tomcat 5
> Reporter: Thomas Spiegl
> Assignee: Thomas Spiegl
> Fix For: 1.1
>
>
> ConversationManagerSessionListener has serveral issues:
> 1) attributeReplaced sets the old instance of conversationManager in conversationWiperThread instead of the new one
> 2) on session expire ConversationManagerSessionListener.attributeRemoved is getting called and session.getId() throws IllegalStateException
> 3) ConversationManagerSessionListener.sessionDestroyed will throw a IllegalStateException as well -> method is useless
> Solution:
> 1) use a unique id for conversationManager instead of session.getId() as a key in conversationWiperThread
> 2) remove HttpSessionListener interface from ConversationManagerSessionListener
--
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.