AdobeStock_455007340

ColdFusion Flex 2 Sample Application

Home » ColdFusion Flex 2 Sample Application

I have posted a sample ColdFusion powered Flex 2 application to Adobe Labs. The Phone Selector application is a very simple example of a ColdFusion powered Flex application. This sample application is deliberately small and highly focused so as to demonstrate ColdFusion Flex integration options. These include:

  • Accessing ColdFusion Components via Flash Remoting
  • The automatic conversion between ColdFusion Components and equivalent ActionScript objects

In addition, the application serves as an example of some basic Flex functionality, including:

  • The use of Flex states to control display
  • The use of renderers and custom components
  • The use of custom formatters

This application is not intended to demonstrate development best-practices, and was designed purely to demonstrate integration capabilities, functionality, and techniques.

49 responses to “ColdFusion Flex 2 Sample Application”

  1. Alex Sherwood Avatar
    Alex Sherwood

    Hi Ben,
    Is there not a live example to see?

  2. jj Avatar
    jj

    w00t!…but i still can’t get the the flexmail to work :*(

  3. shimju david Avatar
    shimju david

    I have installed the application as per the instructions on the word documentation comes with the files. But unfortunately after loading the initializing bar, nothing is appearing on the screen.

  4. shimju david Avatar
    shimju david

    Ben,
    I re-installed the application, but now Iam getting below error :
    Error: code:InvokeFailed string:’Error: Unknown destination ‘ColdFusion’.’ detail:’Couldn’t establish a connection to ‘ColdFusion”
    at mx.rpc::AbstractInvoker/http://www.macromedia.com/2005/flex/mx/internal::invoke()
    at mx.rpc.remoting.mxml::Operation/http://www.macromedia.com/2005/flex/mx/internal::invoke()
    at mx.rpc.remoting::Operation/send()
    at mx.rpc.remoting.mxml::Operation/send()
    at mx.rpc::AbstractService/http://www.macromedia.com/2005/actionscript/flash/proxy::callProperty()
    at Main/___Application1_creationComplete()
    at flash.events::EventDispatcher/dispatchEvent()
    at mx.core::UIComponent/mx.core:UIComponent::dispatchCreationCompleteEvent()
    at mx.core::UIComponent$/http://www.macromedia.com/2005/flex/mx/internal::dispatchCreationCompleteEvents()
    at mx.managers::LayoutManager/mx.managers:LayoutManager::doPhasedInstantiation()
    at mx.core::UIComponent/mx.core:UIComponent::callLaterDispatcher2()
    at mx.core::UIComponent/mx.core:UIComponent::callLaterDispatcher()

  5. Ben Forta Avatar
    Ben Forta

    Shimju, what paths are you installing files in?

  6. Steve Walker Avatar
    Steve Walker

    Ben,
    I am getting the same error as shimju. Initially, I change the installation to what I wanted, but when that didn’t work I decided to follow the istructions verbatim. Test.cfm works fine.

  7. Ryan Guill Avatar
    Ryan Guill

    I too was getting the same error. I found this:
    http://labs.macromedia.com/wiki/index.php/ColdFusion/Flex_Connectivity
    Which tells you to add this line:
    –services=C:CFusionMX7wwwrootWEB-INFflexflex-enterprise-services.xml
    To the compiler. Now I do not get an error, but the application still just sits there with the clock icon and never loads.
    Any ideas? I have followed the instructions to the letter as far as I can tell, twice now.

  8. Steve Walker Avatar
    Steve Walker

    Ryan,
    Thanks for the pointer. I was able to get mine up and running. Two things I had to do was edit the xml file to point to my server (not localhost or 8500) and the compiler line must reference where CF is running: –services=C:… is fine if FlexBuilder(Zorn) is running on the same machine as Coldfusion. As far as I can tell UNC names don’t work so you need to have a drive mapped.

  9. Ryan Guill Avatar
    Ryan Guill

    Im still stuck. What line exactly did you change in your xml file?
    Im running cf and my flex builder on the same box. Which this is confusing me on how I am going to get this to work later on where I am developing locally and then transferring the files to my box.

  10. Steve Walker Avatar
    Steve Walker

    The instructions are on the page and above where you found the instruction for the compiler. It is a change to line 36 of the flex-enterprise-services.xml

  11. Seth Aaronson Avatar
    Seth Aaronson

    Ben,
    Greetings
    I’m having trouble getting this to run, also.
    Below is the error entry from eclipse/zorn.
    Severity 2
    Description java.lang.RuntimeException:org/apache/xpath/CachedXPathAPI
    Resource Phones
    In Folder
    Location
    Creation Time February 2, 2006 11:30:49 AM
    I’m running CFMX7 Developer on port 8500.
    I’ve added
    "–services=C:Docume~1Myusernameworkspace.metadata.pluginszorn.projectdefaultWebApp_2.0WEB-INFflexflex-services.xml"
    to the Flex Compiler/Addidtional compiler arguments in the Project Properties.
    Any ideas how to get this to compile correctly?

  12. Neil Avatar
    Neil

    One thing that isn’t mentioned above or in the docs (if it is I missed it!) is that you need to set Main.mxml as the default application by right clicking on Main.mxml > Application management > Set as default application (in the flex navigator). Took me a while to figure out, but it’s up and running now!

  13. Michael Avatar
    Michael

    After a little playing around, I got the sample application working perfectly. I used it as a model to start experimenting with Flex builder. I have a very simple application that contains only a datagrid. I’m trying to bind the results of a ColdFusion query (via a properly mapped CFC) to the datagrid. It appears that something is being returned by the CFC, but the grid contains only empty rows (one for each element that would have been returned by the query). When I click on one of the datagrid column headers to see what happens, I get the following message:
    "Cannot determine comparator for SortField with name ‘fieldname’."
    The CFC returns data to a cfdump test page just fine. How does one go about using data returned by a CFC that uses the CFQUERY tag? I’ve been scouring the Labs site for documentation, but none is to be found.
    Thank You,
    M. McConnell

  14. Michael Avatar
    Michael

    For those interested, I posted the question I asked above in the Adobe Labs wiki for ColdFusion Connectivity and Mr. Nimer posted an answer. As I suspected, I was missing something relatively simple to get the Flash application to use data returned by a CFQUERY. He told me to change the column names in the datagrid to all upper case because that’s the way CFQUERY returns the data. Boom….worked like a charm.
    I got the impression that my initial problem is actually an AS3 bug as Mr. Nimmer also indicated that this problem would be fixed in the next beta.
    M. McConnell

  15. Tariq Ahmed Avatar
    Tariq Ahmed

    Sigh, no luck either. I’m having the same issues as Shimju. I originally had the couldn’t establish connection to coldfusion. Then after adding the –services=C:CFusionMX7wwwrootWEB-INFflexflex-enterprise-services.xml thing in
    FB I get a new error if I access it directly via the file system, or by trying to load it from the web server (http://localhost/CFIDE/samples/Phones/Flex/bin/main.html):
    Error: code:Client.Error.MessageSend string:’Send failed’ detail:’Channel.Connect.Failed error code:NetConnection.Call.Failed string:HTTP: Failed details: http://localhost:8500/flex2gateway/
    at mx.rpc::AbstractInvoker/http://www.macromedia.com/2005/flex/mx/internal::faultHandler()
    at flash.events::EventDispatcher/dispatchEvent()
    at mx.messaging::MessageAgent/fault()
    at mx.messaging::Producer/fault()
    at mx.messaging::ChannelSet/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()
    I’m running an ultra vanilla CF7.01 freshly downloaded from macromedia.com + Mystic installer. Default paths and everything.
    This makes it sound like it couldn’t connect on port 8500? The test.cfm works, and I can do a
    http://localhost/CFIDE/Samples/Phones/CF/Catalog.cfc?wsdl
    I’m running CF in single server mode, how do I check what port it’s on? "telnet localhost 8500" doesn’t work…
    Thx!

  16. Tariq Ahmed Avatar
    Tariq Ahmed

    As a follow up there’s two things that I had to do to get this working.
    – Changing the end point from 8500 to 80. I assumed endpoint meant in a CF context a dedicated flash gateway port.
    – Adding the –services=C:CFusionMX7wwwrootWEB-INFflexflex-enterprise-services.xml part.
    In the final release, will this services parameter still be needed? In an environment where CF7 is at some data center where you can’t access the drives directly, would you just send a copy of that xml file to the flex developers to use when they compile their flex apps?

  17. Gus Avatar
    Gus

    Just a heads up.
    I thought this might have been fixed but when running the Flex Builder plugin with jre1.5.0_06 this error still comes up…
    java.lang.RuntimeException: org/apache/xpath/CachedXPathAPI
    You can fix by pointing Eclipse to j2re-1_4_2 instead.

  18. thinman Avatar
    thinman

    Unable to get the Phone Selector to work.
    Got the pointer in FB2:
    –services=F:CFusionMX7wwwrootWEB-INFflexflex-enterprise-services.xml
    Got the endpoint in flex-enterprise-services.xml:
    <endpoint uri="http://localhost:80{context.root}/flex2gateway/" class="flex.messaging.endpoints.AMFEndpoint"/>
    My CFIDE is i:
    C:InetpubwwwrootCFIDE
    The FES xml file is under my CFMX 7 root on another volume (same box):
    F:CFusionMX7wwwrootWEB-INFflexflex-enterprise-services.xml
    The test.cfm dumps ok, but the Main.mxml file just spins. No errors, just the lil clock.
    Any help? Thanks!

  19. thinman Avatar
    thinman

    OK, I just figured it out:
    Needed to add the all 3 mxml files into the Flex Applications panel of the Properties for the Phones app:
    Right-click the app
    Select Properties
    Select Flex Applications
    Click the ‘Add..’ button
    Select ProductDetails.mxml and Thumb.mxml
    Voila!
    Is this process specific to having CFMX running from a different volume than CFIDE, or is this just a fundamental thing I gotta do with every Flex app (makine sure ALL .mxml files in a project are compiled as applications)?
    Thanks!
    – thin

  20. Ian Skinner Avatar
    Ian Skinner

    YEAH! I finally got the phones app runing. Thinman’s most was the final straw. I suspect this is an issue of copying files into an app. I suspect if you create new .mxml files in a project they will automatically be added. But I do not know.
    PS. I also changed the port numbers in the endpoint node of the services.xml file to 80. And made sure I have the additional services setting pointing to the xml file.
    It would be nice to have much clearer documentation on all these values, what they mean and when and why one would be setting them, especially in a CF multi-home configuration.

  21. Marco Avatar
    Marco

    I followed all steps above, and I must be the only person who can’t get this to work 🙁
    I pointed Flex Compiler to: D:JRun4serverscfusioncfusion-earcfusion-warWEB-INFflexflex-enterprise-services.xml
    That fixed the first problem.
    I added all mxml files in "Flex Applications" window.
    test.cfm file works fine.
    I am using a built-in CF Web Server running on port 8500. My flex2gateway is set to http://localhost:8500/flex2gateway
    I even installed CF with IIS, Apache, tried different port numbers, but after running the app in debug mode the error message was:
    Error: code:Client.Error.MessageSend string:’Send failed’ detail:’Channel.Connect.Failed error code:NetConnection.Call.Failed string:HTTP: Status 404 details: http://localhost:8500/flex2gateway/
    at mx.rpc::AbstractInvoker/http://www.macromedia.com/2005/flex/mx/internal::faultHandler()[C:deventerprise_beta1frameworksmxrpcAbstractInvoker.as:201]
    at flash.events::EventDispatcher/dispatchEvent()
    at mx.messaging::MessageAgent/fault()[C:deventerprise_beta1frameworksmxmessagingMessageAgent.as:433]
    at mx.messaging::Producer/fault()[C:deventerprise_beta1frameworksmxmessagingProducer.as:281]
    at mx.messaging::ChannelSet/mx.messaging:ChannelSet::faultPendingSends()[C:deventerprise_beta1frameworksmxmessagingChannelSet.as:874]
    at mx.messaging::ChannelSet/handleChannelFault()[C:deventerprise_beta1frameworksmxmessagingChannelSet.as:639]
    at flash.events::EventDispatcher/dispatchEvent()
    at mx.messaging::Channel/mx.messaging:Channel::connectFailed()[C:deventerprise_beta1frameworksmxmessagingChannel.as:613]
    at mx.messaging.channels::NetConnectionChannel/mx.messaging.channels:NetConnectionChannel::connectFailed()[C:deventerprise_beta1frameworksmxmessagingchannelsNetConnectionChannel.as:152]
    at mx.messaging.channels::AMFChannel/mx.messaging.channels:AMFChannel::statusHandler()[C:deventerprise_beta1frameworksmxmessagingchannelsAMFChannel.as:291]
    of course, I changed flex2gateway port number to whatever my web server was running on.
    I spent 2 days trying everything 🙁
    Any ideas??

  22. Marco Avatar
    Marco

    In addition to my last post, I found the following entry in cfusion-event.log and cfusion-err.log:
    03/11 13:27:25 error Requested resource ‘/flex2gateway/’ (%2fflex2gateway%2f) not found
    I’m starting to think that my Mystic install didn’t go very well. I found following in my update log:
    32 SUCCESSES
    1 WARNINGS
    2 NONFATAL ERRORS
    0 FATAL ERRORS
    warning is: Additional Notes: WARNING – Source D:JRun4wwwrootWEB-INFweb.xml does not exist.
    2 errors are: ERROR – Unable to locate ASCII text file to be manipulated. Deferring…
    The warning makes sense because the installer was looking in the wrong directory for web.xml However, when I installed CF under D:CFusionMX7 that warning was eliminated, but I was still getting the 2 non fatal errors.
    Still, Ben’s Session Tracker example works fine on my PC using FES. I just can’t get Phone Selector example to work.
    P.S. I am running a developer version of CFMX7.
    I hope I didn’t confuse you too much 🙂

  23. Merritt Avatar
    Merritt

    When I run the example, I get the following error:
    Error: code:Client.Error.MessageSend string:’Send failed’ detail:’Channel.Connect.Failed error code:NetConnection.Call.Failed string:HTTP: Status 405 details: http://localhost:8500/flex2gateway/
    Does anyone know what this means?
    Thanks!
    Merritt

  24. thinman Avatar
    thinman

    Do you have the xml config file set appropriately for your setup? For instance, if you’re running IIS on a Windows box, and you’re not running the built-in CF webserver, you’re running on port 80. Therefore you’ll need to set that value in the enterprise.xml file.
    HTH,
    thin

  25. Merritt Avatar
    Merritt

    Here’s a snippet from my flex config file:
    <channel-definition id="my-cfamf" class="mx.messaging.channels.AMFChannel">
    <endpoint uri="http://localhost:80{context.root}/flex2gateway/" class="flex.messaging.endpoints.AMFEndpoint"/>
    <properties>
    <polling-enabled>false</polling-enabled>
    <serialization>
    <custom-deserializer type="typed-object" class="coldfusion.flash.messaging.io.amf.serializers.TypedObjectDeserializer" />
    </serialization>
    </properties>
    </channel-definition>
    I’ve tried following your directions but just can’t seem to get it working.
    Thanks.

  26. Tariq Ahmed Avatar
    Tariq Ahmed

    Regarding: http://localhost:8500/flex2gateway/
    Ya I got stuck on that one as well when Mystic came out.
    I think the docs need to be reworded from something along the lines:
    "set the port Coldfusion is running on…" Which implies Coldfusion is running on it’s own port vs the webserver port.
    To:
    If you’re using a webserver like IIS, set the port to the port number your webserver is listening to (e.g 80).

  27. Rich Avatar
    Rich

    Hello,
    I Can’t even get past Flex Builders beta 2 Errrors on the MXML Code itself.
    First the namespace is wrong xmlns:mx="http://www.macromedia.com/2005/mxml&quot; needs to be changed to 2006
    It does not even except the <mx:Application> <mx:HBox> <mx:VBox> tags
    I followed the directions in the word doc, which I would expect alittle better from you ben (I have bought many of your books and have never had this much trouble following along with you?)
    I am not sure what is happening but nothing works for me in the Phone app – I guess I will go on to the "session – Tracking" app.
    Now what good is all this if you are just going to hook up to an XML File and not a sample database. I would just use the URLLoader Doh!
    There is only so much time in the day to be F-ing around – Please Test your code.
    Rich

  28. Merritt Avatar
    Merritt

    I finally found a fix that works for me so I’m passing it on. I had to replace my web.xml file with the one provided on Drisgill Blog here:
    http://www.drisgill.com/index.cfm/2006/3/22/Flex-2-Beta-2–flex2gateway-Problem
    Good Luck!
    Merritt

  29. Doug Kronenberger Avatar
    Doug Kronenberger

    Having trouble get the Phone Sample to work.
    I’m trying running on another server so I changed the end point to serve url.
    I just get blank panels and the Show Details Button. Spinning Clock…
    Browser Status bar indicates Transferring data from 10.3.xx.xx …..
    I get this error in the debugger
    RangeError: Error #2006: The supplied index is out of bounds.
    TypeError: Error #1009: null has no properties.
    at mx.messaging.channels::AMFChannel/mx.messaging.channels:AMFChannel::faultHandler()[C:deventerprise_beta2frameworksmxmessagingchannelsAMFChannel.as:362]
    Any Ideas
    Thanks in advance
    Doug Kronenberger
    dougla.kronenberger@med.va.gov

  30. Chris Avatar
    Chris

    Hello Ben,
    if I enable debugging in CF Administrator no content of this flex application is displayed, why?

  31. barry.b Avatar
    barry.b

    Ben, is there a runtime/dynamic alternative to:
    1) hardcoded CFC destinations
    <mx:RemoteObject id="svc" destination="ColdFusion"
    source="CFIDE.samples.Phones.CF.Catalog" … />
    2) hardcoded CFC class names binding to the AS object?
    [Bindable]
    [RemoteClass(alias="CFIDE.samples.Phones.CF.Phone")]
    thanx

  32. tbe Avatar
    tbe

    I have CF running on a separate Linux box. What should I use instead of this line–services=C:CFusionMX7wwwrootWEB-INFflexflex-enterprise-services.xml? (After I compile my flex project I upload the files to the linux box.)
    Nothing I try seems to work. Thanks for any help

  33. TGB Avatar
    TGB

    Everything seems to be installed and configured correctly, test.cfm runs correctly, but when I attempt to run the project I get the following Action Script error:
    [RPC Fault faultString="java.lang.NullPointerException" faultCode="Server.Processing" faultDetail="null"]
    at mx.rpc::AbstractInvoker/http://www.adobe.com/2006/flex/mx/internal::faultHandler()
    at mx.rpc::Responder/fault()
    at mx.rpc::AsyncRequest/fault()
    at ::NetConnectionMessageResponder/NetConnectionChannel.as$42:NetConnectionMessageResponder::statusHandler()
    at mx.messaging::MessageResponder/status()
    Any suggestions would be appreciated.

  34. Tariq Ahmed Avatar
    Tariq Ahmed

    Well make note that this CF sample app was built back in February, those were the Flex Alpha days. The app may need some modifications to work in the latest Flex 2 Beta.

  35. charlie arehart Avatar
    charlie arehart

    Chris asked, "if I enable debugging in CF Administrator no content of this flex application is displayed, why?"
    If I understand your challenge, note that if a CFM page is to return data to a client expecting XML, and you turn on debugging, now the page has the HTML of the debugging output as well, which will choke the XML client. Add <cfsettting showdebugoutput="no"> to the top of any CFM or CFC page generating XML.

  36. eatmorepossum Avatar
    eatmorepossum

    i finally got this sample app running. i wanted to share my success as it may help someone.
    I am running coldfusion mx7.02 with builtin webserver on port 8500 on my laptop.
    I UNINSTALLED Flex Data Services (FDS) as it is not necessary for this app
    my additional compiler arguments in my phone selector->properties/flex compiler look like this
    -services "C:CFusionMX7wwwrootWEB-INFflexservices-config.xml" -locale en_US
    i did not have flex-enterprise-services.xml in this dir. I made my uri gateway changes in services-config.xml (as referenced above).
    here is what LIne 43-44 of my gateway looks like:
    <endpoint uri="http://localhost:8500{context.root}/flex2gateway/" class="flex.messaging.endpoints.AMFEndpoint"/>
    <properties>
    after messing around with this for a few days i finally got it working.
    Now i’m trying to setup the Cairngorm2 Phone Example and running into issues…
    Good luck to all,
    Chris

  37. Ken Reiss Avatar
    Ken Reiss

    I have Flex 2.0 and CFMX7.0.2 on a shared server. Whenever I try to use a RemoteObject, I get a "TypeError: Error #1034: Type Coercion failed: cannot convert Object@2f044c1 to mx.messaging.messages.ErrorMessage." error.
    There is a great article at:
    http://www.adobe.com/devnet/flex/articles/helloworld.html
    which helps understand how to use Flex 2.0 and CF 7.0.2 when you have CF running locally. However, after numerous hours, I just can’t get this to work when CFMX7.0.2 is running on a remote server.
    Do I need to modify my C:CFusionMX7wwwrootWEB-INFflexservices-config.xml file on the server?
    What should I put as my compiler argument (since there is no C drive because the server is remote). I don’t assume it is still –services=C:CFusionMX7wwwrootWEB-INFflexservices-config.xml right?
    What I should put in for my RemoteObject source name (the folder of the cfc?)
    I can do fine with web services, but can’t seem to get data to move through RPC/AMF.
    Any help is apprecaited – I assume others are having this same problem. If you have succeeded at running a Flex 2.0 app by moving data through CFMX7.0.2, pleaes comment on this entry.
    Thank you! Ken.
    PS – See others with the same problem at: http://www.adobe.com/cfusion/webforums/forum/messageview.cfm?catid=585&threadid=1169105&forumid=60

  38. Ken Reiss Avatar
    Ken Reiss

    I tried all sorts of things and still continue to get the following error message:
    [RPC Fault faultString="[MessagingError message=’Unknown destination ‘ColdFusion’.’]" faultCode="InvokeFailed" faultDetail="Couldn’t establish a connection to ‘ColdFusion’"]
    at mx.rpc::AbstractInvoker/http://www.adobe.com/2006/flex/mx/internal::invoke()
    at mx.rpc.remoting.mxml::Operation/http://www.adobe.com/2006/flex/mx/internal::invoke()
    at mx.rpc.remoting::Operation/send()
    at Function/http://adobe.com/AS3/2006/builtin::apply()
    at mx.rpc.remoting.mxml::Operation/send()
    at testwebservices/___Button2_click()
    I am running IIS5.0 with multiple virtual hosts. This is one of the virtual hosts.
    I have the following line in my Flex Builder 2:
    –services=c:CFusionMX7wwwrootWEB-INFflexservices-config.xml
    and always get a "unable to open ‘c:CFusionMX7wwwrootWEB-INFflexservices-config.xml’" error becaue of course I don’t have this file on my development machine – its on my remote server and my local machine can’t see it’s C: drive.
    I searched my server’s entire C drive and don’t see the flex2gateway folder anywhere.
    Perhaps it’s my source attribute? The docs say "The source attribute specifies the dot notation to the CFC from the web root(the classpath to the CFC)." But what is my webroot on a shared server? There is no dot notation to point to it from either my c:inetpubwwwroot or c:cfusionmx7wwwroot because my CFC is in my e: drive in a virtual host folder.
    Has ANYONE successfully gotten Flex 2 to work with CFMX7.0.2 on IIS5.0 with multiple domains? If so HOW?
    Ken.

  39. charlie arehart Avatar
    charlie arehart

    Ken, here are a couple thoughts. I have not yet run the example on a remote server myself, but I hope these may help until someone who has responds.
    First, have you set up the remote server to run 7.02? If so, then the CFusionMX7wwwrootWEB-INFflexservices-config.xml will be under whatever drive has CFMX 7.
    Second, that value is specified in an entry in Flex Builder. Are you saying you put that entry there? If so, then this is why it’s failing. That’s clearly not the right value to put in there. I realize you’re unsure of what TO put in there, but just clarifying that the error is because of that action.
    This is discussed in two key points in the article for this example (http://www.adobe.com/devnet/flex/articles/coldfusionflex_part3_02.html):
    "4; Create a new project in Flex Builder 2. Select ColdFusion Flash Remoting Service as the server technology. Use the default location of the Flex Data Services server. Specify Phone selector as the application name. Specify the samples/Phones/Flex folder as the project location. Specify Main.mxml as the main page.
    5. To use Flash Remoting, specify the following Flex compiler flag in the project properties:
    –services=C:CFusionMX7wwwrootWEB-INFflex services-config.xml "
    Beyond that, your observation that there is no flex2gateway folder is another clue, along with your running on a virtual host. This is reminiscent of a problem that would happen with RDS, and the /CFIDE/main/ide.cfm it calls upon. As of CFMX, this is no longer a real "file/folder" but instead is a servlet mapping in the cfusionmx7/wwwroot/WEB-INF/web.xml. Same for the flex2gateway, which maps to a servlet called MessageBrokerServlet.
    If these things are in your CF7 directory, then you’re half-way there. If not, then you will not be able to connect to that server using Flash Remoting from a Flex 2 app.
    Here’s another test: can you make a request for:
    http://{server.name}:{server.port}{context.root}/flex2gateway/
    For instance, on your localhost, you should be able to make this request:
    http://localhost/flex2gateway/
    Now try the same, as appropriate, for the virtual hosts on your remote machine. If it gets a 404, then you know you have some server configuration issues to resolve. Again, I don’t know the full extent of the answers, but this will at least offer you (and other readers) some info to chew on and your response may offer diagnostics for others to offer more help.

  40. Ken Reiss Avatar
    Ken Reiss

    Hi Charlie,
    Thank you for these pointers.
    1. Yes, Remote Server is setup in 7.0.2. In the CF Administrator -> Flex Integration -> I have checked: Enable Flash Remoting support and Enable Flex Data Management support (with Server Identity set to: ColdFusion)
    2. Yes, I do have "–services=C:CFusionMX7wwwrootWEB-INFflex services-config.xml" and "-locale en_US" in the project properties.
    3. Yes, the "c:/cfusionmx7/wwwroot/WEB-INF/web.xml" file exists, but I don’t see anything for "MessageBrokerServlet" there.
    4. I did test the /flex2gateway both localhost and a virtually hosted website on the box and both respond with a "JRun Servlet Error: 500 No configured channel has an endpoint path ‘/flex2gatewaynull’. No configured channel has an endpoint path ‘/flex2gatewaynull’. " which would make me think it’s properly running the CF stuff. (Not sure how, though – I don’t see anythinkg in IIS or CF Mappings).
    What next?
    I just have such a hard time beleiving that I’m the only one with this problem. Nearly every CF hosting comany uses IIS with virtual domains – How are they running Flex 2 w/ CFMX7.0.2 apps?
    Best regards,
    Ken
    PS – Best wishes to you since leaving New Atlanta – I met you in Hartford CT last year.

  41. charlie arehart Avatar
    charlie arehart

    Ken, thanks for the kind regards. As for your comments, I find point 4 curious. Maybe you meant to say, "which would make me think it’s NOT properly running the CF stuff"? That and yor point 3 (assuming it’s referring to the remote server) suggest that things are not properly setup.
    I will also note that I had some problems myself when I first upgraded 7.01 to 7.02. I couldn’t get things working, and finally punted and reinstalled. I realize that since this is a hosted server you may not (or cannot) get that done, but I’ll just share the observation.
    And I have not yet tried to deploy any apps myself onto a remote server. Hopefull others with more experience there can chime in.
    I wonder if all this issue simply boils down to (all of) us needing help better understanding what parts of the Flex Builder Wizard setup steps regard the config of the local machine on which development is taking place versus what parts relate to the actual server on which deployment will take place.
    Looking at it another way, many have used RDS features in connection with a localhost to do page creation, and then later deployed that code on a remote server. What we have here is an obvious need to get more info on what parts of the setup of the wizard need to reflect the server WHERE THE CODE WILL BE DEPLOYED.
    It’s entirely possible that the whole wizard was instead designed with a presumption that the code would only be deployed locally. Or it may be that features for remote deployment, while possible, just weren’t exposed readily in the wizard interface. It’s a first cut at the tool, I think most would agree.
    Certainly, we can hope that someone from the Flex team may eventaully surface here to share input. I’ll drop a note to some contacts I have. Ben may simply have too much mail to have yet noticed the interchange here. I’m sure his blog entries generate a LOT Of comments for him to wade through.

  42. Simon B Avatar
    Simon B

    Hi, got the app up and running but am curious to how I can test this on my remote server:
    1) What lines of code specifically will I have to change?
    2) Which files do I upload, is it all the bin folder?
    Thanks in advance,
    S

  43. Ken Reiss Avatar
    Ken Reiss

    I finally got the remote, shared server with CFMX 7.0.2 working with a Flex 2.0 app via AMF!
    Here’s how I did it:
    http://www.kenreiss.com/blog/index.cfm/2006/8/10/Flex-20-with-CFMX-702–SUCCESS
    Thank you all for your help!
    Ken.

  44. Tipz Avatar
    Tipz

    Hi guys… am new to flex and was wondering where i could find the best tutorials for beginners… Or do I have to buy one of that tutorial cd’s….
    <a href="http://www.6thproject.com">flash developer london</a>

  45. Newtriks Avatar
    Newtriks

    Hey Tipz: The most obvious ones for starting off with flex are –
    http://www.adobe.com/devnet/flex/?tab:quickstart=1
    http://www.adobe.com/devnet/flex/?tab:cookbook=1
    The second providing solutions from different developers tinkering with flex…I also found the below links very informative and useful, offering tips and tutorials to guide you on yo journey…
    http://www.cfcdeveloper.com/index.cfm?mode=cat&catid=B187A463-3048-2B9C-F48FF7C87F3FA21B
    http://www.onflex.org/ted/
    http://tech.groups.yahoo.com/group/flexcoders/
    Good luck, Simon

  46. Paul Avatar
    Paul

    I’m lost. I’m hosting with crystaltech.com and they don’t seem to be much help. I’ve followed instructions as far as I can and even been to Ben Reiss’s blog.
    I can get test.cfm to work, but the app itself just shows a blank screen. I’m sure I haven’t set one of the paths correctly.
    It seems we need to know the paths of things like CFIDE and Flex2Gateway on the remote server. So, I spoke to the hosting company and the guy says that my HelloWorld app loads, so that must mean that the environment is setup correctly. I replied that the HelloWorld app doesn’t use remoting and asked him to please give me some of the paths that I’m being asked for, e.g the root paths. He doesn’t know what I’m on about. I actually don’t know why HelloWorld loads but the Phones app doesn’t, so I can’t straighten him out. I feel I’m pretty close and just need the last piece of the puzzle.

  47. Paul Avatar
    Paul

    Hi Ben,
    I have tried everything everyone has suggested and still cannot get mine working with CF and FB2 running on my machine. Are there any clean easy-to-follow documents coming out soon?

  48. Paul Avatar
    Paul

    FINALLY! it’s working. Two things I did:
    1) Ben’s docs on http://www.adobe.com/devnet/flex/articles/coldfusionflex_part3_02.html say (at point 8):
    "Extract the Flex files (Main.mxml, Thumbnail.mxml, ProductDetails.mxml, FeatureFormatter.as, and Phone.as) to the samples/Phones/Flex folder…"
    But, it doesn’t mention two other files "Phone_Selector_as0606.htm" and "Thumb.mxml", which were also extracted upon unzipping the phones app. So, I copied these two files into my C:CFusionMX7wwwrootCFIDEsamplesPhonesFlex directory.
    2) I added 4 XML files as "Runnable application files" as per Thin’s suggestion above. These files are: main.mxml, ProductDetails.mxml, Thumb.mxml and Thumbnail.mxml. You add these by right-clicking on the application, then selecting "Properties", then "Flex Applications" from the left-hand nav, then clicking the "Add" button, then holding down the control key and highlighting all the mxml files you see. Make sure Main.mxml is the default.
    Sweet!

  49. Paul Avatar
    Paul

    Has anyone figured out all the intracacies of deploying the phones app to a web server?

Leave a Reply