Skip to main content
Known Participant
September 1, 2010
Question

CF 9.01 Upgrade breaks Flex Gateway - Help!!!!

  • September 1, 2010
  • 1 reply
  • 5077 views

I have an AIR app which is using DataServicesMessaging with subtopics enabled.  I can create the Consumer in AIR but when I subscribe, I get the following error:

"Error","cfthread-0","08/31/10","21:03:35",,"CATALOG_ATTRIBUTES_831AE0FE-B7D2-90A5-87AD-CAC5E01116D9: Event handler exception."

flex.messaging.MessageException: Event handler exception.

at coldfusion.flex.CFEventGatewayAdapter.allowSend(CFEventGatewayAdapter.java:376)

at flex.messaging.services.messaging.SubscriptionManager.addSubtopicSubscribers(SubscriptionManager.java:330)

at flex.messaging.services.messaging.SubscriptionManager.addSubtopicSubscribers(SubscriptionManager.java:311)

at flex.messaging.services.messaging.SubscriptionManager.getSubscriberIds(SubscriptionManager.java:264)

at flex.messaging.services.MessageService.pushMessageToClients(MessageService.java:495)

at coldfusion.flex.CFEventGatewayAdapter.send(CFEventGatewayAdapter.java:250)

at coldfusion.eventgateway.flex.FlexMessagingGateway.outgoingMessage(FlexMessagingGateway.java:204)

at coldfusion.runtime.CFPage.SendGatewayMessage(CFPage.java:269)

at cfCatalogService2ecfc315059253$func_CFFUNCCFTHREAD_CFCATALOGSERVICE2ECFC3150592531.runFunction(C:\inetpub\wwwroot\staging9sites\staging9si\com\pmdm\suppliers\services\CatalogService.cfc:110)

at coldfusion.runtime.UDFMethod.invoke(UDFMethod.java:472)

at coldfusion.runtime.UDFMethod$ArgumentCollectionFilter.invoke(UDFMethod.java:368)

at coldfusion.filter.FunctionAccessFilter.invoke(FunctionAccessFilter.java:55)

at coldfusion.runtime.UDFMethod.runFilterChain(UDFMethod.java:321)

at coldfusion.runtime.UDFMethod.invoke(UDFMethod.java:220)

at coldfusion.runtime.UDFMethod.invokeCFThread(UDFMethod.java:201)

at coldfusion.thread.Task.invokeFunction(Task.java:274)

at coldfusion.thread.Task.run(Task.java:140)

at coldfusion.scheduling.ThreadPool.run(ThreadPool.java:201)

at coldfusion.scheduling.WorkerThread.run(WorkerThread.java:71)

This topic has been closed for replies.

1 reply

Known Participant
September 2, 2010

Looking at the stack trace it would appear there is an issue with allowing subtopic subscriptions - perhaps there's some configuration parameters that have changed in CF 9.01?  The error occurs the very moment that I attempt to subscribe to the destination.

Anyone from Adobe can comment?????

Known Participant
September 2, 2010

Here's how the error looks from the AIR app:

[MessageFaultEvent faultCode="Server.Processing" faultDetail=null faultString="Event handler exception." rootCause=null type="fault" bubbles=false cancelable=false eventPhase=2]

Not real helpful.

Adobe Employee
September 3, 2010

Jeff,

       In CF 9.0.1 allowSend and allowSubscribe event calls is delegated to the user defined allowSend and allowSubscribe methods defined on the gateway cfc. This would allow you to get control to prevent anyone from subscribing or sending to a particular subtopic. These methods can return either a true or false based on whether subscription or sending should be allowed for that user.

The only condition though is that these functions will be invoked in gateway cfc only if the gateway id is specified under the messaging destination in messaging-config.xml instead of the default * present under the destination.

1. While subscribing, consumer.subtopic has to be set to the subtopic string.

2. While sending, DSSubtopic has to be set on the message header.
msg.headers["DSSubtopic"] = "abc";

3. In onincomingmessage, DSSubtopic has to be on the message header by picking it up from the event object.

   <cfset msg.headers["DSSubtopic"] = event.data.headers.DSSubtopic />   

4. allow-subpoic has to set to true in the messaging-config.xml destination.4.

            <server>
    <allow-subtopics>true</allow-subtopics>
   </server>

It looks to me that this error is coming up when allowSend is being invoked on the gateway cfc. Although care is taken that if the method is not defined in the gateway cfc, a default true is returned back. Try adding an allowSend method that takes in an argument of type any that just returns true.

Also can you give me a sample code that is causing this error? Both the code on the client side that subscribes and the entry in messaging-config.xml.

Rakshith