AdobeStock_455007340

ColdFusion Flash Remoting Configuration in Flex 2 Beta 2

Several of you have contacted me with problems using Flex beta 2 to connect to ColdFusion via Flash Remoting. A couple of the issues turned out to be configuration problems in flex-enterprise-services.xml (installed under WEB-INFflex, and needed by the Flex compiler). Here is the file as it works for me:










*



false

remote

false

false

false








false




[Flex] false
false
false
false
Endpoint.* Service.* Configuration Message.*




en
de
fr
es


true
20
{context.root}/WEB-INF/flex/flex-enterprise-services.xml
{context.root}/WEB-INF/web.xml




If you are not using ColdFusion’s integrated HTTP server, be sure to change the port from 8500 (or just drop the port altogether if using port 80).

22 responses to “ColdFusion Flash Remoting Configuration in Flex 2 Beta 2”

  1. rd Avatar
    rd

    Still having tons of problems on my home computer, but for reference. I installed everything on my work computer and remoting worked flawlessly out of the box (without editing any xml). So i’m thinking something is crufty on my home computer even after uninstalling cf and fb. Personally I think it had to do with the old Flex Enterprise Data stuff that I installed in prev beta (and have since uninstalled). I think something is hanging on to that rather than the remoting.

  2. rd Avatar
    rd

    I think I have tracked the problem down to some missing lines in the web.xml file involving the flex2gateway. Not sure why after uninstalling everything, neither flex, cf, or the cf connector would add these lines. More info at:
    http://www.drisgill.com/index.cfm/2006/3/22/Flex-2-Beta-2–flex2gateway-Problem

  3. Rich Avatar
    Rich

    I am not having any trouble getting the Coldfusion/Flex Connection to work. I have a made a simple hello world that is able to pass data back and forth from a Flex Client to a .CFC. I just can’t get any of your samples to work with Beta 2. I keep getting compile errors: Implicit coercion of a value with static type ‘Object’ to a possibly unrelated type ‘Phone’ Main.mxml Phones line 37.

  4. Ben Forta Avatar
    Ben Forta

    Rich, is that where you are passing list.selectedItem (an object) to ProductDetails (which expects a Phone object)? If so, change {list.selectedItem} to {Phone(list.selectedItem)}, that casting should do it.
    — Ben

  5. Jeremy Avatar
    Jeremy

    I too am having trouble with Flash Remoting in Flex 2 Beta 2. I have the Coldfusion/Flex Connection installed on Coldfusion MX 7 Stardard, and am using the Flex 2 Eclipse Plugin for development. When trying to run the Phones example I am only getting a busy cursor once the app loads. I have updated the flex-enterprise-services.xml file to reflect my configuration (IIS port 80). I have also added the –services argument to the compiler option. I have compared the FES file posted against mine with the only difference being the entpoint-uri.

  6. Muzak Avatar
    Muzak

    I kept getting an error like this when trying the new adapter:
    Error: faultCode:Client.Error.MessageSend faultString:’Send failed’ faultDetail:’Channel.Connect.Failed error NetConnection.Call.Failed: HTTP: Status 500′
    at mx.rpc::AbstractInvoker/http://www.adobe.com/2006/flex/mx/internal::faultHandler()
    at flash.events::EventDispatcher/dispatchEvent()
    at mx.messaging::MessageAgent/fault()
    at mx.messaging::Producer/fault()
    at mx.messaging::ChannelSet/::faultPendingSends()
    at mx.messaging::ChannelSet/handleChannelFault()
    at flash.events::EventDispatcher/dispatchEvent()
    at mx.messaging::Channel/mx.messaging:Channel::connectFailed()
    at mx.messaging.channels::NetConnectionChannel/mx.messaging.channels:NetConnectionChannel::connectFailed()
    at mx.messaging.channels::AMFChannel/mx.messaging.channels:AMFChannel::statusHandler()
    Took me a while to figure out what was wrong, but when I checked the Coldfusion logs (JRUN4logscfusion-event.log) i noticed the required JVM was not installed. The one that comes with JRUN4 apparently does not meet the required version.
    I installed JAVA SDK 1.4.2.11, changed the JVM in the JRUN administrator, restarted server and everything started working 😉
    Also note that I changed the <endpoint> into: http://{context.root}/flex2gateway/
    That way I am able to connect from any PC on the network.
    Hope this helps,
    Muzak

  7. Muzak Avatar
    Muzak

    Correction, the endpoint looks like this:
    <endpoint uri="{context.root}/flex2gateway/" class="flex.messaging.endpoints.AMFEndpoint" />

  8. Jeremy Avatar
    Jeremy

    After finding more time I was able to finally get a gateway connection. My endpoint uri had to contain the actual host name like this: <endpoint uri="[HOST NAME]/flex2gateway/" class="flex.messaging.endpoints.AMFEndpoint" />. I had also Restarted the server after modifying the flex-enterprise-services.xml file. However, using ServiceCapture as a debug tool for the Remoting calls, the endpoint was NOT relecting my current changes. I’m not sure if it was time, or ONLY making enough modifications to the file and then clicking the Run icon in FB that finally the endpoint was corrected. Now that I have jumped this hurdle, I am encountering anothe issue: Could not find the ColdFusion Component CFIDE.samples.Phones.CF.Catalog. I have placed this sample in the default location, and the test.cfm file included runs fine. Any ideas?

  9. Ed Welch Avatar
    Ed Welch

    Ok..I have tried just about every combination that is listed here..so I will give my setup and see what everyone has to say..here is my error>
    Error: faultCode:Client.Error.MessageSend faultString:’Send failed’ faultDetail:’Channel.Connect.Failed error NetConnection.Call.Failed: HTTP: Status 500′
    at mx.rpc::AbstractInvoker/http://www.adobe.com/2006/flex/mx/internal::faultHandler()
    at flash.events::EventDispatcher/dispatchEvent()
    at mx.messaging::MessageAgent/fault()
    at mx.messaging::Producer/fault()
    at mx.messaging::ChannelSet/::faultPendingSends()
    at mx.messaging::ChannelSet/handleChannelFault()
    at flash.events::EventDispatcher/dispatchEvent()
    at mx.messaging::Channel/mx.messaging:Channel::connectFailed()
    at mx.messaging.channels::NetConnectionChannel/mx.messaging.channels:NetConnectionChannel::connectFailed()
    at mx.messaging.channels::AMFChannel/mx.messaging.channels:AMFChannel::statusHandler()
    Here is my services entry
    –services=y:CFusionMX7wwwrootWEB-INFflexflex-enterprise-services.xml
    I have a mapped drive from my laptop to the webserver and I am using Flexbuilder on my laptop not the webserver.
    My web site runs from the follwoing directory
    I:inetpubwwwroot
    Here is my endpoint from the enterprise-services.xml file
    <endpoint uri="http://localhost{context.root}/flex2gateway/" class="flex.messaging.endpoints.AMFEndpoint"/>
    I have tried the following also:
    <endpoint uri="http://{context.root}/flex2gateway/" class="flex.messaging.endpoints.AMFEndpoint"/>
    <endpoint uri="{context.root}/flex2gateway/" class="flex.messaging.endpoints.AMFEndpoint"/>
    <endpoint uri="http://localhost:80{context.root}/flex2gateway/" class="flex.messaging.endpoints.AMFEndpoint"/>
    <endpoint uri="http://intratest:80{context.root}/flex2gateway/" class="flex.messaging.endpoints.AMFEndpoint"/>
    <endpoint uri="http://intratest{context.root}/flex2gateway/" class="flex.messaging.endpoints.AMFEndpoint"/>
    Any ideas on what the error is from…I am trying to run the Phones sample project. All the project files are located in I:inetpubwwwrootCFIDEsamplesPhones
    Thanks for any help you can provide.
    Ed

  10. Ed Welch Avatar
    Ed Welch

    Does anyone have any ideas about my previous post?
    Thanks

  11. Ed Welch Avatar
    Ed Welch

    Here is a section from my coldfusion-event.log but I am still having problems with the endpoint port…
    04/18 15:05:27 user failed to load: flex.messaging.MessageBrokerServlet
    04/18 15:05:27 error Invalid endpoint port ” specified for channel definition ‘my-cfamf’.
    [1]flex.messaging.config.ConfigurationException: Invalid endpoint port ” specified for channel definition ‘my-cfamf’.
    at flex.messaging.config.ApacheXPathConfigurationParser.channelDefinition(ApacheXPathConfigurationParser.java:355)
    at flex.messaging.config.ApacheXPathConfigurationParser.channelsSection(ApacheXPathConfigurationParser.java:315)
    at flex.messaging.config.ApacheXPathConfigurationParser.parseTopLevelConfig(ApacheXPathConfigurationParser.java:130)
    at flex.messaging.config.ApacheXPathConfigurationParser.parse(ApacheXPathConfigurationParser.java:71)
    at flex.messaging.config.ApacheXPathConfigurationParser.parse(ApacheXPathConfigurationParser.java:61)
    at flex.messaging.config.ConfigurationManager.getMessagingConfiguration(ConfigurationManager.java:52)
    at flex.messaging.MessageBrokerServlet.init(MessageBrokerServlet.java:54)
    at coldfusion.bootstrap.ClassloaderHelper.initServletClass(ClassloaderHelper.java:96)
    at coldfusion.bootstrap.BootstrapServlet.init(BootstrapServlet.java:48)
    at jrun.servlet.WebApplicationService.loadServlet(WebApplicationService.java:1242)
    at jrun.servlet.JRunRequestDispatcher.init(JRunRequestDispatcher.java:748)
    at jrun.servlet.JRunRequestDispatcher.<init>(JRunRequestDispatcher.java:98)
    at jrun.servlet.WebApplicationService.getDispatcher(WebApplicationService.java:865)
    at jrun.servlet.ServletEngineService$1.fetch(ServletEngineService.java:511)
    at jrunx.util.Cache.get(Cache.java:116)
    at jrun.servlet.ServletEngineService.dispatch(ServletEngineService.java:537)
    at jrun.servlet.jrpp.JRunProxyService.invokeRunnable(JRunProxyService.java:204)
    at jrunx.scheduler.ThreadPool$DownstreamMetrics.invokeRunnable(ThreadPool.java:318)
    at jrunx.scheduler.ThreadPool$ThreadThrottle.invokeRunnable(ThreadPool.java:426)
    at jrunx.scheduler.ThreadPool$UpstreamMetrics.invokeRunnable(ThreadPool.java:264)
    at jrunx.scheduler.WorkerThread.run(WorkerThread.java:66)
    [0]javax.servlet.ServletException: Invalid endpoint port ” specified for channel definition ‘my-cfamf’.
    at coldfusion.bootstrap.ClassloaderHelper.initServletClass(ClassloaderHelper.java:104)
    at coldfusion.bootstrap.BootstrapServlet.init(BootstrapServlet.java:48)
    at jrun.servlet.WebApplicationService.loadServlet(WebApplicationService.java:1242)
    at jrun.servlet.JRunRequestDispatcher.init(JRunRequestDispatcher.java:748)
    at jrun.servlet.JRunRequestDispatcher.<init>(JRunRequestDispatcher.java:98)
    at jrun.servlet.WebApplicationService.getDispatcher(WebApplicationService.java:865)
    at jrun.servlet.ServletEngineService$1.fetch(ServletEngineService.java:511)
    at jrunx.util.Cache.get(Cache.java:116)
    at jrun.servlet.ServletEngineService.dispatch(ServletEngineService.java:537)
    at jrun.servlet.jrpp.JRunProxyService.invokeRunnable(JRunProxyService.java:204)
    at jrunx.scheduler.ThreadPool$DownstreamMetrics.invokeRunnable(ThreadPool.java:318)
    at jrunx.scheduler.ThreadPool$ThreadThrottle.invokeRunnable(ThreadPool.java:426)
    at jrunx.scheduler.ThreadPool$UpstreamMetrics.invokeRunnable(ThreadPool.java:264)
    at jrunx.scheduler.WorkerThread.run(WorkerThread.java:66)
    any ideas?

  12. Kevin Roche Avatar
    Kevin Roche

    I have the same problem as Ben but with the Flex2 Beta3.
    The flex-enterprise-services.xml file looks quite different to the one above.
    There is no mention of the coldFusion service in there.
    Can anyone post a good copy from Flex2 Beta3 for me please?
    Kevin

  13. TOM Avatar
    TOM

    can anyone explain me please how to use NetConnectionDebugger with flex2?

  14. enzo Avatar
    enzo

    Ben,
    I just installed Flex 2, and have data connectivity between Flex and WebServices (CFC’s). If I try to convert to using Flash Remoting I get the errors listed here. I have tried every configuration that I have found on the web but so far it has not worked. Any insight you may have would be a great help to me. I am new to Flex, but so far I am really enjoying how easy it is to program.

  15. Ben Forta Avatar
    Ben Forta

    Enzo,
    Are you using a locla CF server running 7.0.2? You should not need to worry about the issues raised in this thread in the final product. So long as Flex Builder can find the CF services-config.xml it should just work. This thread applied to the beta when stuff was not as simple.
    — Ben

  16. Pablo Avatar
    Pablo

    I’m having similar problems, with Flex Builder 2 and a local copy of CF 7.0.2. I’ve configured my services-config.xml to point to the local web server and host, but still no luck. Any ideas?
    [RPC Fault faultString="Send failed" faultCode="Client.Error.MessageSend" faultDetail="Channel.Connect.Failed error NetConnection.Call.Failed: HTTP: Failed"]
    at mx.rpc::AbstractInvoker/http://www.adobe.com/2006/flex/mx/internal::faultHandler()
    at mx.rpc::Responder/fault()
    at mx.rpc::AsyncRequest/fault()
    at mx.messaging::ChannelSet/::faultPendingSends()
    at mx.messaging::ChannelSet/channelFaultHandler()
    at flash.events::EventDispatcher/flash.events:EventDispatcher::dispatchEventFunction()
    at flash.events::EventDispatcher/dispatchEvent()
    at mx.messaging::Channel/mx.messaging:Channel::connectFailed()
    at mx.messaging.channels::PollingChannel/mx.messaging.channels:PollingChannel::connectFailed()
    at mx.messaging.channels::AMFChannel/mx.messaging.channels:AMFChannel::statusHandler()

  17. Ben Forta Avatar
    Ben Forta

    Pablo, can you make calls to the Flash Remoting 2 path without an error? Also, if you start CF in console mode are you seeing any useful log info?
    — ben

  18. Pablo Avatar
    Pablo

    Thanks for the quick response, Ben. I figured out the problem on my own: the ColdFusion setup was actually fine — the problem was that my browser (Firefox 2) had cached the SWF from a previous build, where the flex/services-config.xml was pointing to the wrong place. I cleared out the cache, and everything started working.
    Thanks!

  19. Sameer Avatar
    Sameer

    Hi! I am using Flex 3 beta remoting with CF MX 7.0.2 but keep getting "Send Failed" error.
    Here’s snippet from C:CFusionMX7wwwrootWEB-INFflexservices-config.xml:
    The file originally contained:
    uri="http://{server.name}:{server.port}{context.root}/flex2gateway/"
    I changed it to:
    1. uri="http://localhost:8500{context.root}/flex2gateway/
    2. uri="http://localhost{context.root}/flex2gateway/
    Still no luck. Please help! Thanks.

  20. Bob Klaas Avatar
    Bob Klaas

    I am currently experiencing the same problem as Sameer. I developed a Flex application that retrieves data from a ColdFusion CFC by use of a remote object. I’m using Flex Builder 3 along with Coldfusion MX7. I am new to Flex and I am having a hard time trying to troubleshoot my problem. When I deployed the application on my local machine, everything worked perfect. The problem started when trying to deploy it to our company server. I keep getting a "send failed" error. I then tried to verify that my Flex gateway was working properly by entering http://www.my-website.com/flex2gateway/ in my browser. Sure enough I received a 404 error instead of a blank screen. I have saturated forums trying to figure out what I need to do in order to deploy this application. Everything I have tried seems to have a dead end. Halp!

  21. Bob Klaas Avatar
    Bob Klaas

    Thanks to rd’s post on 3/22, I’ve launched my first Flex application!
    If anyone runs into a Flex gateway 404 error, I suggest looking at the link below. It solved my gateway problem and I was able to launch my first Flex application.
    http://www.drisgill.com/index.cfm/2006/3/22/Flex-2-Beta-2–flex2gateway-Problem
    Thanks RD!
    Ben, I would like to thank you for supplying the public with a useful and detailed blog. I have solved many of problems here!

  22. rd (randy drisgill) Avatar
    rd (randy drisgill)

    Wow I can’t believe that post so long ago is still helping folks. 2006! Glad it helped.

Leave a Reply