Results 1 to 8 of 8

Thread: The FlexSession is invalid

  1. #1
    Join Date
    Feb 2011
    Posts
    1

    Default 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");
    cs.addChannel(amf);
    cs.addChannel(amf2);
    }
    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/http://www.adobe.com/2006/flex/mx/internal::faultHandler()[E:\dev\4.x\frameworks\projects\rpc\src\mx\rpc\Abst ractInvoker.as:345]
    at mx.rpc::Responder/fault()[E:\dev\4.x\frameworks\projects\rpc\src\mx\rpc\Resp onder.as:68]
    at mx.rpc::AsyncRequest/fault()[E:\dev\4.x\frameworks\projects\rpc\src\mx\rpc\Asyn cRequest.as:113]
    at mx.messaging::ChannelSet/faultPendingSends()[E:\dev\4.x\frameworks\projects\rpc\src\mx\messagin g\ChannelSet.as:1614]
    at mx.messaging::ChannelSet/channelFaultHandler()[E:\dev\4.x\frameworks\projects\rpc\src\mx\messagin g\ChannelSet.as:1206]
    at flash.events::EventDispatcher/dispatchEventFunction()
    at flash.events::EventDispatcher/dispatchEvent()
    at mx.messaging::Channel/connectFailed()[E:\dev\4.x\frameworks\projects\rpc\src\mx\messagin g\Channel.as:1128]
    at mx.messaging.channels::PollingChannel/connectFailed()[E:\dev\4.x\frameworks\projects\rpc\src\mx\messagin g\channels\PollingChannel.as:406]
    at mx.messaging.channels::AMFChannel/faultHandler()[E:\dev\4.x\frameworks\projects\rpc\src\mx\messagin g\channels\AMFChannel.as:543]

  2. #2

    Default The FlexSession is invalid

    I'm running into the same issue as you. I think this was working until 1.5.0.M1 but is broken in 1.5.0.M2, please have a look at https://jira.springsource.org/browse/FLEX-186 and watch/vote as it suits you

  3. #3
    Join Date
    Apr 2005
    Location
    San Francisco, CA
    Posts
    1,224

    Default

    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.
    Jeremy Grelle

    Staff Engineer, Web Products Team
    SpringSource

  4. #4

    Default

    I inherited the integration on the product where I'm using this and I cannot begin to imagine how I'm going to write a small demo version of it to place in Jira. But if you could point me to any samples or template projects that are already being distributed with spring-flex, it would be very helpful. I could quickly try to build them in env and get them to match what I'm experiencing and then attach them back in Jira.

  5. #5
    Join Date
    Apr 2005
    Location
    San Francisco, CA
    Posts
    1,224

    Default

    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?

    etc.
    Jeremy Grelle

    Staff Engineer, Web Products Team
    SpringSource

  6. #6
    Join Date
    Apr 2005
    Location
    San Francisco, CA
    Posts
    1,224

    Default

    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?
    Jeremy Grelle

    Staff Engineer, Web Products Team
    SpringSource

  7. #7
    Join Date
    Apr 2005
    Location
    San Francisco, CA
    Posts
    1,224

    Default

    @tmcnamara,

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

    Staff Engineer, Web Products Team
    SpringSource

  8. #8

    Default

    Thanks for resolving it in Jira ... all in a day's work!

Tags for this Thread

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •