0

我试图通过来自 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>

如何解决这个问题呢?

4

0 回答 0