I'm implementing a FlexSessionListener like:
public void sessionDestroyed(FlexSession flexSession) {
if (LOG.isInfoEnabled()) {
LOG.info("Flex session destroyed: " + flexSession
+ " - "
+ flexSession.getUserPrincipal());
}
unregisterSessions(flexSession); // accesses session attribute
try {
flexSession.removeSessionDestroyedListener(this);
}
catch (LocalizedException e) {
LOG.warn("Error during sessionDestroyed for " + flexSession, e);
}
}
Using the flexSession parameter causes exceptions, which is surprising at best.
Accessing a session attribute causes this:
flex.messaging.LocalizedException: The FlexSession is invalid.
at flex.messaging.FlexSession.checkValid(FlexSession.java:515)
at flex.messaging.FlexSession.getAttribute(FlexSession.java:269)
at com.acesis.security.SessionRegistry.unregisterSessions(SessionRegistr y.java:492)
at com.acesis.security.SessionRegistry.sessionDestroyed(SessionRegistry. java:345)
at flex.messaging.FlexSession.destroy(FlexSession.java:250)
at flex.messaging.endpoints.rtmp.RTMPFlexSession.close(RTMPFlexSession.j ava:42)
at flex.messaging.endpoints.rtmp.NIORTMPConnection.invalidateFlexSession (NIORTMPConnection.java:221)
at flex.messaging.endpoints.rtmp.RTMPFlexSession.invalidate(RTMPFlexSess ion.java:47)
at flex.messaging.security.LoginManager.logout(LoginManager.java:192)
at flex.messaging.services.AuthenticationService.serviceCommand(Authenti cationService.java:65)
at flex.messaging.MessageBroker.routeCommandToService(MessageBroker.java :622)
at flex.messaging.endpoints.AbstractEndpoint.serviceMessage(AbstractEndp oint.java:298)
at flex.messaging.endpoints.rtmp.AbstractRTMPServer.dispatchMessage(Abst ractRTMPServer.java:682)
at flex.messaging.endpoints.rtmp.NIORTMPConnection$RTMPReader.run(NIORTM PConnection.java:665)
at edu.emory.mathcs.backport.java.util.concurrent.ThreadPoolExecutor$Wor ker.runTask(ThreadPoolExecutor.java:643)
at edu.emory.mathcs.backport.java.util.concurrent.ThreadPoolExecutor$Wor ker.run(ThreadPoolExecutor.java:668)
at java.lang.Thread.run(Thread.java:595)
Removing the FlexSessionListener causes this:
flex.messaging.LocalizedException: The FlexSession is invalid.
at flex.messaging.FlexSession.checkValid(FlexSession.java:515)
at flex.messaging.FlexSession.removeSessionDestroyedListener(FlexSession .java:372)
at com.acesis.security.SessionRegistry.sessionDestroyed(SessionRegistry. java:347)
at flex.messaging.FlexSession.destroy(FlexSession.java:250)
at flex.messaging.endpoints.rtmp.RTMPFlexSession.close(RTMPFlexSession.j ava:42)
at flex.messaging.endpoints.rtmp.NIORTMPConnection.invalidateFlexSession (NIORTMPConnection.java:221)
at flex.messaging.endpoints.rtmp.RTMPFlexSession.invalidate(RTMPFlexSess ion.java:47)
at flex.messaging.security.LoginManager.logout(LoginManager.java:192)
at flex.messaging.services.AuthenticationService.serviceCommand(Authenti cationService.java:65)
at flex.messaging.MessageBroker.routeCommandToService(MessageBroker.java :622)
at flex.messaging.endpoints.AbstractEndpoint.serviceMessage(AbstractEndp oint.java:298)
at flex.messaging.endpoints.rtmp.AbstractRTMPServer.dispatchMessage(Abst ractRTMPServer.java:682)
at flex.messaging.endpoints.rtmp.NIORTMPConnection$RTMPReader.run(NIORTM PConnection.java:665)
at edu.emory.mathcs.backport.java.util.concurrent.ThreadPoolExecutor$Wor ker.runTask(ThreadPoolExecutor.java:643)
at edu.emory.mathcs.backport.java.util.concurrent.ThreadPoolExecutor$Wor ker.run(ThreadPoolExecutor.java:668)
at java.lang.Thread.run(Thread.java:595)
The FDS documentation doesn't specify that you cannot do anything with the flexSession in a sessionDestroyed call. The same code has worked, IIRC, in GMC 4. It seems that the behavior changed in GMC 5 or 6. I'm running the released bits now.
Is this the intended behavior?
--
Jürgen Failenschmid
public void sessionDestroyed(FlexSession flexSession) {
if (LOG.isInfoEnabled()) {
LOG.info("Flex session destroyed: " + flexSession
+ " - "
+ flexSession.getUserPrincipal());
}
unregisterSessions(flexSession); // accesses session attribute
try {
flexSession.removeSessionDestroyedListener(this);
}
catch (LocalizedException e) {
LOG.warn("Error during sessionDestroyed for " + flexSession, e);
}
}
Using the flexSession parameter causes exceptions, which is surprising at best.
Accessing a session attribute causes this:
flex.messaging.LocalizedException: The FlexSession is invalid.
at flex.messaging.FlexSession.checkValid(FlexSession.java:515)
at flex.messaging.FlexSession.getAttribute(FlexSession.java:269)
at com.acesis.security.SessionRegistry.unregisterSessions(SessionRegistr y.java:492)
at com.acesis.security.SessionRegistry.sessionDestroyed(SessionRegistry. java:345)
at flex.messaging.FlexSession.destroy(FlexSession.java:250)
at flex.messaging.endpoints.rtmp.RTMPFlexSession.close(RTMPFlexSession.j ava:42)
at flex.messaging.endpoints.rtmp.NIORTMPConnection.invalidateFlexSession (NIORTMPConnection.java:221)
at flex.messaging.endpoints.rtmp.RTMPFlexSession.invalidate(RTMPFlexSess ion.java:47)
at flex.messaging.security.LoginManager.logout(LoginManager.java:192)
at flex.messaging.services.AuthenticationService.serviceCommand(Authenti cationService.java:65)
at flex.messaging.MessageBroker.routeCommandToService(MessageBroker.java :622)
at flex.messaging.endpoints.AbstractEndpoint.serviceMessage(AbstractEndp oint.java:298)
at flex.messaging.endpoints.rtmp.AbstractRTMPServer.dispatchMessage(Abst ractRTMPServer.java:682)
at flex.messaging.endpoints.rtmp.NIORTMPConnection$RTMPReader.run(NIORTM PConnection.java:665)
at edu.emory.mathcs.backport.java.util.concurrent.ThreadPoolExecutor$Wor ker.runTask(ThreadPoolExecutor.java:643)
at edu.emory.mathcs.backport.java.util.concurrent.ThreadPoolExecutor$Wor ker.run(ThreadPoolExecutor.java:668)
at java.lang.Thread.run(Thread.java:595)
Removing the FlexSessionListener causes this:
flex.messaging.LocalizedException: The FlexSession is invalid.
at flex.messaging.FlexSession.checkValid(FlexSession.java:515)
at flex.messaging.FlexSession.removeSessionDestroyedListener(FlexSession .java:372)
at com.acesis.security.SessionRegistry.sessionDestroyed(SessionRegistry. java:347)
at flex.messaging.FlexSession.destroy(FlexSession.java:250)
at flex.messaging.endpoints.rtmp.RTMPFlexSession.close(RTMPFlexSession.j ava:42)
at flex.messaging.endpoints.rtmp.NIORTMPConnection.invalidateFlexSession (NIORTMPConnection.java:221)
at flex.messaging.endpoints.rtmp.RTMPFlexSession.invalidate(RTMPFlexSess ion.java:47)
at flex.messaging.security.LoginManager.logout(LoginManager.java:192)
at flex.messaging.services.AuthenticationService.serviceCommand(Authenti cationService.java:65)
at flex.messaging.MessageBroker.routeCommandToService(MessageBroker.java :622)
at flex.messaging.endpoints.AbstractEndpoint.serviceMessage(AbstractEndp oint.java:298)
at flex.messaging.endpoints.rtmp.AbstractRTMPServer.dispatchMessage(Abst ractRTMPServer.java:682)
at flex.messaging.endpoints.rtmp.NIORTMPConnection$RTMPReader.run(NIORTM PConnection.java:665)
at edu.emory.mathcs.backport.java.util.concurrent.ThreadPoolExecutor$Wor ker.runTask(ThreadPoolExecutor.java:643)
at edu.emory.mathcs.backport.java.util.concurrent.ThreadPoolExecutor$Wor ker.run(ThreadPoolExecutor.java:668)
at java.lang.Thread.run(Thread.java:595)
The FDS documentation doesn't specify that you cannot do anything with the flexSession in a sessionDestroyed call. The same code has worked, IIRC, in GMC 4. It seems that the behavior changed in GMC 5 or 6. I'm running the released bits now.
Is this the intended behavior?
--
Jürgen Failenschmid