Announcement Announcement Module
Collapse
No announcement yet.
UndeclaredThrowableException on logout Page Title Module
Move Remove Collapse
X
Conversation Detail Module
Collapse
  • Filter
  • Time
  • Show
Clear All
new posts

  • UndeclaredThrowableException on logout

    Before I get into the details I'm running the following,
    - BlazeDS 4.0.0
    - Spring BlazeDS Integration 1.5.0
    - Jetty 6.1.11.

    Every time I logout of my flex application using, "channelSet.logout" I get the following stacktrace on my server output.

    Code:
    [BlazeDS]09/13/2011 14:51:59.217 [DEBUG] [Endpoint.FlexSession] FlexSession with id 'l2tfwywyte4i' for an Http-based client connection has been invalidated.
    [BlazeDS]09/13/2011 14:51:59.519 [DEBUG] [Endpoint.AMF] Serializing AMF/HTTP response
    Version: 3
      (Message #0 targetURI=/4/onStatus, responseURI=)
        (Typed Object #0 'flex.messaging.messages.ErrorMessage')
          headers = (Object #1)
          rootCause = null
          body = null
          correlationId = "8AD12227-3C6B-E18A-943A-64C670EAC190"
          faultDetail = null
          faultString = "There was an unhandled failure on the server. java.lang.reflect.UndeclaredThrowableException"
          clientId = "80879B9F-00D0-B283-658B-FD2D42942CE5"
          timeToLive = 0.0
          destination = "auth"
          timestamp = 1.315950719511E12
          extendedData = null
          faultCode = "Server.Processing"
          messageId = "8087C8A2-7086-0BC0-CC1B-320B363E13F4"
    This results in an error response coming back to the client and am unable to determine whether they've logged out correctly or not.

    I think I've tracked down to the problem to the following:

    In the logout function of flex.messaging.security.LoginManager it does the following:

    Code:
    // Always invoke the command's logout hook.
    loginCommand.logout(getCurrentPrincipal());
    
    if (FlexContext.isPerClientAuthentication())
        FlexContext.setUserPrincipal(null);
    else
        FlexContext.getFlexSession().invalidate();
    The loginCommand.logout invalidates the HttpSession, then on the next line it calls FlexContext.getFlexSession().invalidate() which also calls 'invalidate()' on the underlying HttpSession (line 324).

    Code:
    try
    {
        // Invalidating the HttpSession will trigger invalidation of the HttpFlexSession
        // either via the sessionDestroyed() event if registration as an HttpSession listener worked
        // or via the valueUnbound() event if it didn't.
        httpSession.invalidate();
    }
    Attempting to call invalidate on an already invalidated session throws an IllegalStateException. (org.mortbay.jetty.servlet.HashSessionManager$Sess ion -> AbstractSessionManager.Session line 948)

    To quickly patch the issue myself I attempted to subclass HttpFlexSession and check to see whether the underlying HttpSession is valid before invalidating, but I can't figure out a way to have Spring BlazeDS integration us my custom FlexSession class.

    Any help would be appreciated!!

    Thanks,
    Nick
Working...
X