本文介绍了RemoteObject 不一致的通道位置的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个 swf,出于某种原因,它有四个 RemoteObjects 指向同一个 ChannelId,但他们将该频道列为位于两个不同的位置.在五个 RemoteObject 中的四个中,一切都按预期运行,但在第四个(WidgetService)中,dev 上的版本从 dev.context.root 切换到 loc.context.root.更令人困惑的是,它只在开发服务器上执行此操作(QA 和生产很好,本地构建也很好).

配置文件中的相关信息如下:

#这是来自build.properties,Ant使用的#在服务器上构建swfflex.sdk.dir =/path/to/sdk/flex_sdk_3.2.0.3958flex.sdk.bin.dir = ${flex.sdk.dir}/binflex.sdk.framework.dir = ${flex.sdk.dir}/frameworksflex.sdk.libs.dir = ${flex.sdk.framework.dir}/libsflex.sdk.locale.dir = ${flex.sdk.framework.dir}/locale/{locale}flex.sdk.locale = en_USloc.context.root =/somename-1.0.4.0000dev.context.root =/dev-somenameqa.context.root =/somenameprod.context.root =/#此值根据构建更改.context.root = ${dev.context.root}
<!-- 所有 RemoteObject 都指向这里 --><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"/></频道定义><!-- 服务列表--><目的地 id="用户服务"><属性><工厂>弹簧</工厂><source>userService</source></属性><频道><channel ref="my-amf"></channel></频道></目的地><目标 id="系统服务"><属性><工厂>弹簧</工厂><source>systemService</source></属性><频道><channel ref="my-amf"></channel></频道></目的地><目的地 id="SessionService"><属性><工厂>弹簧</工厂><source>sessionService</source></属性><频道><channel ref="my-amf"></channel></频道></目的地><目的地 id="VistorService"><属性><工厂>弹簧</工厂><source>visitorService</source></属性><频道><channel ref="my-amf"></channel></频道></目的地><目的地 id="WidgetService"><属性><工厂>弹簧</工厂><source>widgetService</source></属性><频道><channel ref="my-amf"></channel></频道></目的地>
解决方案

事实证明,另一位开发人员构建了一个 swf,该 swf 在运行时使用项目的本地配置而不是服务器配置加载.

I have a swf which, for some reason, has four RemoteObjects pointing to the same ChannelId, but they are listing that channel as being at two different spots. In four of the five RemoteObjects, everything behaves as expected, but in the fourth (WidgetService), the version on dev is switching from dev.context.root to loc.context.root. To make matters more confusing, it only does this on the dev server (QA and production are fine, as are local builds).

The relevant information from the config files follows:

    #This is from build.properties, which is used by Ant
    #to build the swf on the server
    flex.sdk.dir           = /path/to/sdk/flex_sdk_3.2.0.3958
    flex.sdk.bin.dir       = ${flex.sdk.dir}/bin
    flex.sdk.framework.dir = ${flex.sdk.dir}/frameworks
    flex.sdk.libs.dir      = ${flex.sdk.framework.dir}/libs
    flex.sdk.locale.dir    = ${flex.sdk.framework.dir}/locale/{locale}
    flex.sdk.locale        = en_US

    loc.context.root       = /somename-1.0.4.0000
    dev.context.root       = /dev-somename
    qa.context.root        = /somename
    prod.context.root      = /
    #this value is changed based on the build.
    context.root           = ${dev.context.root}
<!-- All of the RemoteObjects are directed here -->
<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"/>
</channel-definition>

<!-- A list of the services -->
<destination id="UserService">
    <properties>
        <factory>spring</factory>
        <source>userService</source>
    </properties>
    <channels>
        <channel ref="my-amf"></channel>
    </channels>
</destination>

<destination id="SystemService">
    <properties>
        <factory>spring</factory>
        <source>systemService</source>
    </properties>
    <channels>
        <channel ref="my-amf"></channel>
    </channels>
</destination>

<destination id="SessionService">
    <properties>
        <factory>spring</factory>
        <source>sessionService</source>
    </properties>
    <channels>
        <channel ref="my-amf"></channel>
    </channels>
</destination>

<destination id="VistorService">
    <properties>
        <factory>spring</factory>
        <source>visitorService</source>
    </properties>
    <channels>
        <channel ref="my-amf"></channel>
    </channels>
</destination>

<destination id="WidgetService">
    <properties>
        <factory>spring</factory>
        <source>widgetService</source>
    </properties>
    <channels>
        <channel ref="my-amf"></channel>
    </channels>
</destination>
解决方案

It turns out that another developer built a swf which was loaded at run-time using the project's local configuration instead of the server configuration.

这篇关于RemoteObject 不一致的通道位置的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

08-03 20:43
查看更多