问题
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>
回答1:
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.
来源:https://stackoverflow.com/questions/1070719/remoteobject-inconsistent-channel-location