I am trying to set up a scenario where a Flex application would be able to use resources written in two different web application implementing BlazeDS.
I originally tried to do it by specifying a channel set in my mxml code and then setting this as the channel set of the service in mxml. However, although this worked, I was getting duplicate session errors.
It was suggested in one of the answers to my question linked to above that I could/should see about setting up channels with different endpoints. I guess this means that the Flex app will only be connecting to one service as it sees it but that the service will actually be delivering this service from another location as well.
I tried doing the following in my 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"/>
</channel-definition>
<channel-definition id="my-amf2" class="mx.messaging.channels.AMFChannel">
<endpoint url="http://localhost:7001/dataservice1/messagebroker/amf" class="flex.messaging.endpoints.AMFEndpoint"/>
</channel-definition>
But I get the following errors in my weblogic console when trying to start up my server.
Could not register endpoint 'my-amf' because its URL, '/messagebroker/amf', is already used by endpoint 'my-amf2'
and
"MessageBrokerServlet" failed to preload on startup in Web application: "/dataservice2". flex.messaging.config.ConfigurationException: Could not register endpoint 'my-amf' because its URL, '/messagebroker/amf', is already used by endpoint 'my-amf2'
and
Unable to set the activation state to true for the application '_appsdir_DataService2_dir'. weblogic.application.ModuleException: [HTTP:101216]Servlet: "MessageBrokerServlet" failed to preload on startup in Web application: "/dataservice2".
I'm guessing that this is because you can only have one channel of class mx.messaging.channels.AMFChannel. Is this correct?
In general, is there a way around any of the problems I'm experiencing? I'm open to different solutions.
I've googled and read for hours and hours but can't find anything about this.
We want to have a common functionality service that is shared amongst all applications and an application specific service that provides services specific to that application.
{server.port}
token could well be replaced with the same port. You could use FireBug or Charles to monitor exactly at what address it's trying to connect. – RIAstar