今天发现一个flex session异常,确切地说是adobe air中发现的,总是报如下异常信息:
Channel.Ping.Failed error Detected duplicate HTTP-based FlexSessions, generally due to the remote host disabling session cookies. Session cookies must be enabled to manage the client connection correctly. url: 'http://[host]//messagebroker/amf;jsessionid=74D073B548B2729651B3EE4D6A9D45DD''
Channel.Ping.Failed error Detected duplicate HTTP-based FlexSessions, generally due to the remote host disabling session cookies. Session cookies must be enabled to manage the client connection correctly. url: 'http://[host]//messagebroker/amf;jsessionid=85FD9DE9DD7D955948376F0A8DD3AA68''
Channel.Ping.Failed error Detected duplicate HTTP-based FlexSessions, generally due to the remote host disabling session cookies. Session cookies must be enabled to manage the client connection correctly. url: 'http://[host]//messagebroker/amf;jsessionid=B93B022F2C60F464D0FFA4BB985D97DB''
请注意,[host]后面是两个/,并且后面的jsessionid是不同的,这三个请求是先后执行的,实际要执行四个请求,第一个是可以正常的。从第二个开始就报错了。
经过搜索和排查原因,发现我的问题和网上其他同学遇到的还不完全一样,虽然异常信息是相似的,但解决方法却不同。 经过测试,我发现是那两个/引起的,当我把它处理为一个/时,异常就消失了。所以有理由相信,这个可能是blazeds在处理过程中引发的问题(或许是个bug)。 所以最终我的解决办法就是判断uri,如果结尾处缺少/时才给它加上一个/,否则不再追加/,这样就不会出现如上的url形式(//)了,也就避开了异常现象。