Flex无效会话错误

时间:2013-10-29 05:27:12

标签: actionscript-3 tomcat flex flex4 blazeds

尝试通过flex中的远程对象调用在tomcat中运行的服务,当我调用远程对象时,它会抛出flex无效会话错误

Channel.Ping.Failed error There was an unhandled failure on the server. The FlexSession is invalid. url: 'http://localhost:8080/Server/messagebroker/amf/'
[RemoteObject  destination="reinforcementService" channelSet="[ChannelSet null ]"]
Send failed

代码

<s:CallResponder id="getReinforcementsResult"/>
        <services:ReinforcementService id="reinforcementService" fault="Alert.show(event.fault.faultString + '\n' + event.fault.faultDetail)" showBusyCursor="true"/>

<s:RemoteObject id="ro2" destination="reinforcementService"  endpoint="{parentApplication.serviceURL}" result="ro2_resultHandler(event)" fault="ro2_faultHandler(event)"/>

我用

调用方法
ro2.getReinforcements();

我断开结果处理程序中的远程对象以避免DuplicateFlexSessions错误

ro2.disconnect();   

和services-config.xml中的通道定义如下

  <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>true</polling-enabled>
        <add-no-cache-headers>true</add-no-cache-headers>
        <!-- <invalidate-session-on-disconnect>true</invalidate-session-on-disconnect> -->
        <invalidate-session-on-disconnect>true</invalidate-session-on-disconnect>
</properties>
    </channel-definition>

如何解决这个问题?

0 个答案:

没有答案