31 Replies Latest reply on Feb 16, 2011 5:10 PM by khatchik82

    Server.Processing.DuplicateSessionDetected

    gauravnasit

      Hi,

       

      I am using BlazedDS remote objects in my application and following is the error I am getting.

       

      faultCode:Server.Processing.DuplicateSessionDetected

      faultString:'Detected duplicate HTTP - based FlexSessions, generally due to the remote host disabling session cookies. Session coolkies must be enable to manage the client connection correctly.'

      faultDetail: 'null'

       

      Along with this error I also get the following error most times.

      faultCode:Server.Processing

      faultString:'There was an unhandler failure on the server. The FlexSession is invalid.'

      faultCode:'null'

       

      My environment for the application is as follows:

       

      Server - Websephere v6.1

      Browser - IE 6, Mozilla 3.x. I have tried on both the browsers and it occurs in both of them.

      Flex - Flex SDK - 3.2

      Java - Java 5.0

       

      My application is as follows:

      I have configured BlazedDS on the server side to access remote objects to get data onto the client which is written in Flex/ActionScript.

       

      when i run the application it seems to run fine. But at times the above error occurs. I am unable to reproduce this error AT WILL. I am not sure about the reason that this error seems to occur.

       

      I have attached the config files for my application. The limit being 3 files the one remaining services-config.xml is as below:

       

      <?xml version="1.0" encoding="UTF-8"?>
      <services-config>

       

          <services>
              <service-include file-path="remoting-config.xml" />
              <service-include file-path="proxy-config.xml" />
              <service-include file-path="messaging-config.xml" />       
          </services>

       

          <security>
              <login-command class="flex.messaging.security.WebSphereLoginCommand" server="WebSphere"/>
          </security>

       

          <channels>

       

              <channel-definition id="my-amf" class="mx.messaging.channels.AMFChannel">
                  <endpoint url="http://{server.name}:{server.port}/{context.root}/messagebroker/amf" class="flex.messaging.endpoints.AMFEndpoint"/>
                  <properties>
                      <polling-enabled>false</polling-enabled>
                  </properties>
              </channel-definition>

       

              <channel-definition id="my-secure-amf" class="mx.messaging.channels.SecureAMFChannel">
                  <endpoint url="https://{server.name}:{server.port}/{context.root}/messagebroker/amfsecure" class="flex.messaging.endpoints.SecureAMFEndpoint"/>
                  <properties>
                         <!--HTTPS requests on some browsers do not work when pragma "no-cache" are set-->
                      <add-no-cache-headers>false</add-no-cache-headers>
                  </properties>
              </channel-definition>

       

              <channel-definition id="my-polling-amf" class="mx.messaging.channels.AMFChannel">
                  <endpoint url="http://{server.name}:{server.port}/{context.root}/messagebroker/amfpolling" class="flex.messaging.endpoints.AMFEndpoint"/>
                  <properties>
                      <polling-enabled>true</polling-enabled>
                      <polling-interval-seconds>4</polling-interval-seconds>
                  </properties>
              </channel-definition>


          </channels>

       

          <logging>
              <target class="flex.messaging.log.ConsoleTarget" level="Error">
                  <properties>
                      <prefix>[BlazeDS] </prefix>
                      <includeDate>false</includeDate>
                      <includeTime>false</includeTime>
                      <includeLevel>false</includeLevel>
                      <includeCategory>false</includeCategory>
                  </properties>
                  <filters>
                      <pattern>Endpoint.*</pattern>
                      <pattern>Service.*</pattern>
                      <pattern>Configuration</pattern>
                  </filters>
              </target>
          </logging>

       

          <system>
              <redeploy>
                  <enabled>false</enabled>
              </redeploy>
          </system>

       

      </services-config>

       

      It has been quite some time that i have been unable to resolve the issue. Any help in resolving the issue is appreciated.

       

      Thanks a bunch..!!

       

      Please let me know if you need to know anything else regarding the issue.

        • 1. Re: Server.Processing.DuplicateSessionDetected
          gauravnasit Level 1

          Also,

           

          For the above case I am using session beans which have the methods that are being exposed as remote services.

           

          The one file that was remaining to be attached, namely, the services-config.xml is been attached here.

          • 2. Re: Server.Processing.DuplicateSessionDetected
            Ron Pasch

            Have you ever found the problem that was causing this? We're running into the same problems and have a pretty similar set up.

            • 3. Re: Server.Processing.DuplicateSessionDetected
              TomEuchre

              This problem only appears for us too under Websphere 6.2. Under Tomcat there is no issue. There must be more people using BlazeDS on websphere, right? Anyone got an idea?

              • 4. Re: Server.Processing.DuplicateSessionDetected
                gauravnasit Level 1

                No resolution yet for the mentioned problem..:(

                • 5. Re: Server.Processing.DuplicateSessionDetected
                  javanatic23@yahoo.com

                  We have the same issue... using Tomcat proxied by Apache.

                  Any ideas?

                  • 6. Re: Server.Processing.DuplicateSessionDetected
                    aubweb Level 1

                    Hi,

                     

                    Same problem here with Flex and Coldfusion 9.

                     

                    It's very anoying, I looked for a sollution with no luck

                     

                    Aubry

                    • 7. Re: Server.Processing.DuplicateSessionDetected
                      Alex Glosband Adobe Employee

                      Hi.

                       

                      The client needs to be able to maintain session with the server for BlazeDS to work properly. When a BlazeDS application connects to the server over an endpoint, a FlexClient is created on the server and associated with the JEE session. The id of the FlexClient is returned to the Flex application as the DSID header on the response message and then the Flex application will pass this DSID header with every request.

                       

                      There are some situations where a single application could have more than one FlexClient. For example, if your application uses two different endpoints to communicate with the server at the same time there would be a different FlexClient for each endpoint. Also, if you loaded two BlazeDS applications into a parent application as sub-apps, each BlazeDS sub-app would have its own FlexClient.

                       

                      The duplicate session detected errors come from the FlexClient id on the request already being associated with a different JEE session on the server. A FlexClient can only be associated with a single session. BlazeDS checks that the FlexClient id on the request and the JEE session for the request (this will be represented by either a JSESSIONID session cookie header or jsessionid url parameter) are what it expects. If the FlexClient id is already associated with another session we throw an error.

                       

                      In most cases these errors stem from two initial ping requests getting made to the server at roughly the same time. This could be the application connecting up to the server over two endpoints or two sub-apps in a parent application connecting to the server at the same time. If the client doesn't have a session with the server when these requests go out, a JEE session will be created for each request. Also a FlexClient will get created for each request and associated with its respective JEE session. The problem happens when the responses get sent back to the client. Each response will have a different session cookie header. The last response will win and its session cookie header will get stored by the browser. Now, when additional requests get made to the server, the JEE session will only be correct for one of the endpoints or sub apps. The other one will cause duplicate session detected errors.

                       

                      The solution for this in most cases is to make sure that you already have a session with the server before connecting up over two endpoints at the same time. There are a number of ways you can implement this in your application which I won't go into in detail here.

                       

                      It sounds like people are getting these errors for a number of reasons. Hopefully understanding how the duplicate session detection works will help you debug your issues.

                       

                      For anyone who is interested, I have also blogged about this topic in detail here.

                       

                      http://www.alexglosband.com/?p=3

                      • 8. Re: Server.Processing.DuplicateSessionDetected
                        aubweb Level 1

                        Hi,

                        Thanks Alex !
                        "The solution for this in most cases is to make sure that you already have a session with the server before connecting up over two endpoints at the same time. There are a number of ways you can implement this in your application which I won't go into in detail here."
                        I am using Coldfusion 9 and in my application.cfm i've put :
                        "<cfapplication name="App name"
                        SESSIONMANAGEMENT="Yes"
                        SESSIONTIMEOUT="#CreateTimeSpan(0, 0, 30, 0)#">
                        This doesn't fx my issue.
                        I have only one CFM page (with html inside) that holds my application swf (Flex app) and of course many cfc's (in a separate folder, but same server)
                        Like this :
                        --My server
                        --------My app
                        -----------------application.cfm
                        -----------------index.cfm
                        -----------------myapp.swf
                        --------CFC folder
                        -----------------application.cfm
                        -----------------folder 1
                        ---------------------------mycfc1.cfc
                        ---------------------------mycfc2.cfc
                        -----------------folder 2
                        --------------------------- ...
                        --------------------------- ...
                        --------------------------- ...
                        -----------------folder 3
                        --------------------------- ...
                        --------------------------- ...
                        I don't know what to do ... sometimes I recieve this error more than 100 times a day...
                        Regards,
                        Aubry

                        • 9. Re: Server.Processing.DuplicateSessionDetected
                          Alex Glosband Adobe Employee

                          How easy is it for you to reproduce the error?

                           

                          I'd like to know what is the situation that is causing you to get these errors. It doesn't sound like you have the problem I discussed with two ping requests reaching the server at roughly the same time.

                           

                          If you can