Quantcast
Channel: Adobe Community : Popular Discussions - LiveCycle Data Services
Viewing all articles
Browse latest Browse all 58696

Invalid session in FlexSessionListener.sessionDestroyed

$
0
0
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(SessionRegistry.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.java:42)
at flex.messaging.endpoints.rtmp.NIORTMPConnection.invalidateFlexSession(NIORTMPConnection.j ava:221)
at flex.messaging.endpoints.rtmp.RTMPFlexSession.invalidate(RTMPFlexSession.java:47)
at flex.messaging.security.LoginManager.logout(LoginManager.java:192)
at flex.messaging.services.AuthenticationService.serviceCommand(AuthenticationService.java:6 5)
at flex.messaging.MessageBroker.routeCommandToService(MessageBroker.java:622)
at flex.messaging.endpoints.AbstractEndpoint.serviceMessage(AbstractEndpoint.java:298)
at flex.messaging.endpoints.rtmp.AbstractRTMPServer.dispatchMessage(AbstractRTMPServer.java: 682)
at flex.messaging.endpoints.rtmp.NIORTMPConnection$RTMPReader.run(NIORTMPConnection.java:665 )
at edu.emory.mathcs.backport.java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPo olExecutor.java:643)
at edu.emory.mathcs.backport.java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolEx ecutor.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.java:42)
at flex.messaging.endpoints.rtmp.NIORTMPConnection.invalidateFlexSession(NIORTMPConnection.j ava:221)
at flex.messaging.endpoints.rtmp.RTMPFlexSession.invalidate(RTMPFlexSession.java:47)
at flex.messaging.security.LoginManager.logout(LoginManager.java:192)
at flex.messaging.services.AuthenticationService.serviceCommand(AuthenticationService.java:6 5)
at flex.messaging.MessageBroker.routeCommandToService(MessageBroker.java:622)
at flex.messaging.endpoints.AbstractEndpoint.serviceMessage(AbstractEndpoint.java:298)
at flex.messaging.endpoints.rtmp.AbstractRTMPServer.dispatchMessage(AbstractRTMPServer.java: 682)
at flex.messaging.endpoints.rtmp.NIORTMPConnection$RTMPReader.run(NIORTMPConnection.java:665 )
at edu.emory.mathcs.backport.java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPo olExecutor.java:643)
at edu.emory.mathcs.backport.java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolEx ecutor.java:668)
at java.lang.Thread.run(Thread.java:595)


The FDS documentation doesn't specify that you cannot doanything 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

Viewing all articles
Browse latest Browse all 58696

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>