Announcement Announcement Module
No announcement yet.
The FlexSession is invalid Page Title Module
Move Remove Collapse
Conversation Detail Module
  • Filter
  • Time
  • Show
Clear All
new posts

  • The FlexSession is invalid

    I'm trying to implement a custom AMFChannel based on the environment my app is deployed in.

    Here's my action script class.....this ChannelSet is set to every remote object out there by a parent mxml.
    public class ServerUtil
    import mx.core.FlexGlobals;
    import mx.messaging.ChannelSet;
    import mx.messaging.channels.AMFChannel;
    import mx.controls.Alert;

    public function ServerUtil()

    private static var cs:ChannelSet;

    public static function getChannelSet():ChannelSet {
    if (cs == null){
    cs = new ChannelSet();
    var amf:AMFChannel = newAMFChannel("my-amf", "http://"+FlexGlobals.topLevelApplication.parameters.blaze Url + "/csrware/messagebroker/amf");
    var amf2:AMFChannel = new AMFChannel("my-amf", "http://"+FlexGlobals.topLevelApplication.parameters.blaze Url + "/csrware/messagebroker/amf");
    return cs;

    When I start up the app. Everything is fine.
    Kill the browser, bring the app back up...everything is fine.
    Logout\Login...everything is fine.
    But when I open a new tab, or close a tab and reopen a tab, my RPC calls stop working and I get the following error.

    I'm wondering if it has something to do with Spring's Flex session mangement.

    [RPC Fault faultString="Send failed" faultCode="Client.Error.MessageSend" faultDetail="Channel.Ping.Failed error There was an unhandled failure on the server. The FlexSession is invalid. url: 'http://localhost:8080/csrware/messagebroker/amf'"]
    at mx.rpc::AbstractInvoker/[E:\dev\4.x\frameworks\projects\rpc\src\mx\rpc\Abst]
    at mx.rpc::Responder/fault()[E:\dev\4.x\frameworks\projects\rpc\src\mx\rpc\Resp]
    at mx.rpc::AsyncRequest/fault()[E:\dev\4.x\frameworks\projects\rpc\src\mx\rpc\Asyn]
    at mx.messaging::ChannelSet/faultPendingSends()[E:\dev\4.x\frameworks\projects\rpc\src\mx\messagin g\]
    at mx.messaging::ChannelSet/channelFaultHandler()[E:\dev\4.x\frameworks\projects\rpc\src\mx\messagin g\]
    at mx.messaging::Channel/connectFailed()[E:\dev\4.x\frameworks\projects\rpc\src\mx\messagin g\]
    at mx.messaging.channels::PollingChannel/connectFailed()[E:\dev\4.x\frameworks\projects\rpc\src\mx\messagin g\channels\]
    at mx.messaging.channels::AMFChannel/faultHandler()[E:\dev\4.x\frameworks\projects\rpc\src\mx\messagin g\channels\]

  • #2
    So far I am unable to reproduce this. I'm going to need some more details, including the Spring configuration being used, and exact steps that result in the error. A small test app (ideally attached to the Jira) that shows the error would speed up the process.

    P.S. Please use the code tags in future postings to enhance readability.


    • #3
      The "secured" sample in the version of the Test Drive that comes with the project distribution is what I generally use to test these things, so that would be a good start. So far I've been unable to reproduce it there, even when making some minor changes such as disabling the Remember-Me functionality.

      Other than that, just providing me with some details of how your configuration differs from the Test Drive would be a good start. For example:

      1) Are you using a flat ApplicationContext rather than hierarchical? (I.e., everything, including the Flex configuration defined in the ApplicationContext that is loaded by the ContextLoaderListener)

      2) Does your Spring Security configuration differ from the Test Drive in any significant way?

      3) Are you using any of the additional Flex security features such as the "flex:secured-channel" or "flex:secured-endpoint-path" tags?



      • #4
        Ahh, ok, I see from the Jira issue that you are using a custom LoginCommand. One change is that the LoginCommand is now responsible (just as AbstractAuthenticationProcessingFilter does) for calling SessionAuthenticationStrategy.onAuthentication().

        Are you extending the provided SpringSecurityLoginCommand? In doing so, are you perhaps overriding this behavior? Or are you otherwise not calling SessionAuthenticationStrategy?


        • #5

          I wonder if your issue might be altogether different. What version of Spring BlazeDS and Spring Security are you using?