9 Replies Latest reply on Dec 21, 2006 9:26 AM by StevenErat

    "Using ColdFusion with Flex" samples dont work!

    Dr._Goomba
      Has anyone successfully gotten ANY of the FDS samples to work from the Flex and Coldfusion Dev Center?

      I am about to give up on using FDS, lack of documentation, no working examples, bugs, problems galore, grrrrrr!

      If you have gotten
      Using ColdFusion with Flex – Part 1: Creating and running a Contact Manager application
      or
      Using ColdFusion with Flex – Part 2: Creating and running a CRM application

      please post a step by step on how you got it to work. Thank you sooooooooooo much!!
        • 1. Re: "Using ColdFusion with Flex" samples dont work!
          LL@Work Level 1
          This is not the ONLY way but here is a simplified step-by-step approach to running the CRM Sample on Windows in 7 Steps:

          1. Download and Install Flex Data Services 2 Express to the built-in web server on port 8700 (default installation)
          http://www.adobe.com/go/tryflex
          2. Open a command window and go to c:\fds2\jrun4\bin
          3. Start the default server by typing jrun –start default
          4. Open a browser and request the sample apps page at http://localhost:8700/samples
          5. Click CRM Sample
          6. Click Run CRM
          7. Respond to the prompts to install Flash Player 9 if necessary
          (If mxml page is blank, close the browser and click on Run CRM again)

          You should see the Flex CRM sample application and data
          • 2. Re: "Using ColdFusion with Flex" samples dont work!
            LL@Work Level 1
            Sorry, I gave you instructions on the FDS CRM sample without the CF backend.

            Here are the steps to getting the Contact Manager application from http://www.adobe.com/devnet/flex/articles/coldfusionflex_part1.html up and running:
            1. Download and Install Flex Data Services 2 Express to the built-in web server on port 8700 (default installation)
            http://www.adobe.com/go/tryflex
            2. Download and install ColdFusion MX 7.02 to the built in web server on port 8500
            http://www.adobe.com/go/trycoldfusion
            3. Download and install Flash Player 9
            http://www.adobe.com/go/getflashplayer
            4. Download and install Flex Builder 2 (for the ColdFusion Extensions)
            http://www.adobe.com/go/tryflex
            5. Download contact_sample.zip
            http://www.adobe.com/devnet/flex/articles/coldfusionflex_part1.html
            6. Unzip contactmgr.mxml, Hourglass.mxml, mini.mxml, wait.png, and Contact.as to C:\fds2\jrun4\servers\default\samples and be sure “Use folder names” is checked!
            7. Open C:\fds2\resources\config\services-config.xml in your favorite text editor
            8. Select and copy:
            <!-- ColdFusion specific RTMP channel -->
            <channel-definition id="cf-dataservice-rtmp" class="mx.messaging.channels.RTMPChannel">
            <endpoint uri="rtmp://{server.name}:2048" class="flex.messaging.endpoints.RTMPEndpoint"/>
            <properties>
            <idle-timeout-minutes>20</idle-timeout-minutes>
            <serialization>
            <!-- This must be turned off for any CF channel -->
            <instantiate-types>false</instantiate-types>
            </serialization>
            </properties>
            </channel-definition>

            <!-- ColdFusion specific HTTP channel -->
            <channel-definition id="cf-polling-amf" class="mx.messaging.channels.AMFChannel">
            <endpoint uri=" http://{server.name}:{server.port}/{context.root}/messagebroker/cfamfpolling" class="flex.messaging.endpoints.AMFEndpoint"/>
            <properties>
            <serialization>
            <!-- This must be turned off for any CF channel -->
            <instantiate-types>false</instantiate-types>
            </serialization>
            <polling-enabled>true</polling-enabled>
            <polling-interval-seconds>8</polling-interval-seconds>
            </properties>
            </channel-definition>
            9. Open C:\fds2\jrun4\servers\default\samples\WEB-INF\flex\services-config.xml in your favorite text editor
            10. Paste the copied text just under the last </channel-definition> tag and above the closing </channels> tag
            11. Save C:\fds2\jrun4\servers\default\samples\WEB-INF\flex\services-config.xml
            12. Open C:\fds2\jrun4\servers\default\samples\WEB-INF\flex\data-management-config.xml in your favorite text editor
            13. copy and paste the following to just under the last <adapter-definition id> tag and just above the </adapters> tag:
            <adapter-definition id="coldfusion-dao" class="coldfusion.flex.CFDataServicesAdapter"/>
            14. Open C:\fds2\resources\config\data-management-config.xml in your favorite text editor
            15. Select and copy:
            <!-- ======================================== -->
            <!-- ColdFusion Sample - Contact sample application -->
            <!-- ======================================== -->
            <destination id="cfcontact">

            through all of this code (roughly lines 288-395):
            <!--
            Determines whether order is important for this filled collection. Allows for
            performance optimization when order is not important.
            Optional. Default value is true.
            -->
            <ordered>true</ordered>
            </fill-method>
            </server>
            </properties>
            </destination>
            16. Paste the copied text to C:\fds2\jrun4\servers\default\samples\WEB-INF\flex\data-management-config.xml just under the last </destination> and just above the </service> tag
            17. Unzip Contact.cfc, ContactDAO.cfc, ContactAssembler.cfc, test.cfm and contact.mdb to C:\CFusionMX7\wwwroot (Built-in web server root on port 8500) and be sure “Use folder names” is checked!
            18. Logon to the Coldfusion Administrator
            19. Create a datasource called FlexDataServices and point it to C:\CFusionMX7\wwwroot\contact_sample\samples\contact\db\contact.mdb (Be sure the datasource verifies ok)
            20. Create a mapping called samples mapped to C:\CFusionMX7\wwwroot\contact_sample\samples
            21. Test the Coldfusion side of the application by requesting http://{server_name}:8500/contact_sample/samples/contact/testContactAssembler.cfm
            You should see the following output:
            Output from Fill
            8 records
            Tom Jordahl
            Joe Doe
            Randy Crew
            Testing Man
            Jim Dandy
            Bill Sahlas
            William Chan
            Jack Sahlas
            22. Open C:\fds2\jrun4\servers\default\samples\contact_sample\dataservice\contact\contactmgr.mxml in your favorite text editor.
            23. Find this line of code: ds = new DataService("cfcontact");
            24. Change cfcontact to cfcontact-default
            25. Save and exit all edited files
            26. Start Flex by typing “jrun –start default” at c:\fds2\jrun4\bin
            27. Request the Contact Manager sample by requesting http://{server_name}:8700/samples/contact_sample/dataservice/contact/contactmgr.mxml
            28. You should see the Contact Manager application data
            • 3. Re: &quot;Using ColdFusion with Flex&quot; samples dont work!
              watsonValu
              Hi, I have a similar problem, as shown below: I think it is where I place the contact.as. I have moved this file to various positions but always get the same results. Can someone pse help cause 'I am dying here'.

              Watson
              ---------------------------
              Compilation Results

              Errors, warnings or exceptions were found while compiling /contact_sample/dataservice/contact/contactmgr.mxml. Visit the online Flex documentation or API reference for further information.


              --------------------------------------------------------------------------------


              4 Errors found.

              Error /contact_sample/dataservice/contact/contactmgr.mxml:31
              Definition samples.contact could not be found.


              30: import mx.rpc.events.*;
              31: import samples.contact.*;
              32:


              Error /contact_sample/dataservice/contact/contactmgr.mxml:37
              Type was not found or was not a compile-time constant: Contact.


              36: [Bindable]
              37: public var contact:Contact;
              38:


              Error /contact_sample/dataservice/contact/contactmgr.mxml:81
              Access of undefined property Contact.


              80: dg.selectedItem = event.item;
              81: contact = event.item as Contact;
              82: }


              Error /contact_sample/dataservice/contact/contactmgr.mxml:102
              Call to a possibly undefined method Contact.


              101: dg.selectedIndex = -1;
              102: contact = new Contact();
              103: }




              • 4. Re: &quot;Using ColdFusion with Flex&quot; samples dont work!
                LL@Work Level 1
                It looks like your contact.mxml can't find the contact.cfc
                Be sure you followed step #17 correctly.
                Was the test in step #21 successful?
                • 5. Re: &quot;Using ColdFusion with Flex&quot; samples dont work!
                  LL@Work Level 1
                  In response to a comment from this thread regarding steps #23 and #24, apparently they are not necessary:
                  23. Find this line of code: ds = new DataService("cfcontact");
                  24. Change cfcontact to cfcontact-default
                  An edit must have been made to the ":\fds2\jrun4\servers\default\samples\WEB-INF\flex\data-management-config.xml" file in the walk-through used for this step-by-step.
                  • 6. &quot;Using ColdFusion with Flex&quot; samples dont work!
                    Dr._Goomba Level 1
                    Im sorry, this is just exremely fustrating. I had it working once, now i cant get it to work again. When i had it working the first time, i modified the {server.name} with my IP address and it seemed to work. Doing it again however does not.

                    Now when i run this app at http://localhost:8700/samples/dataservice/cfcontact/contactmgr.mxml
                    I receive an immediate error stating: "error invoking fill-method 'fill' for destination cfcontact: Permission denied"

                    Question on #17 "be sure “Use folder names” is checked!" what is this referring too?

                    Here is what my configuration looks like:

                    ------------------------------------------------------------------------------------------ -------------
                    C:\fds2\jrun4\servers\default\samples\WEB-INF\flex\data-management-config.xml

                    <adapters>
                    <adapter-definition id="actionscript" class="flex.data.adapters.ASObjectAdapter" default="true"/>
                    <adapter-definition id="java-dao" class="flex.data.adapters.JavaAdapter"/>
                    <adapter-definition id="coldfusion-dao" class="coldfusion.flex.CFDataServicesAdapter"/>
                    </adapters>

                    <destination id="cfcontact">
                    <adapter ref="coldfusion-dao"/>
                    <channels>
                    <channel ref="cf-dataservice-rtmp"/>
                    <channel ref="cf-polling-amf"/>
                    </channels>

                    <properties>
                    <component>samples.contact.ContactAssembler</component>

                    <scope>request</scope>

                    <access>
                    <method-access-level>remote</method-access-level>
                    </access>

                    <property-case>
                    <force-cfc-lowercase>false</force-cfc-lowercase>
                    <force-query-lowercase>false</force-query-lowercase>
                    <force-struct-lowercase>false</force-struct-lowercase>
                    </property-case>

                    <metadata>
                    <identity property="contactId"/>
                    </metadata>

                    <network>
                    <!-- Add network elements here -->
                    </network>

                    <server>
                    <fill-method>
                    <use-fill-contains>false</use-fill-contains>
                    <auto-refresh>true</auto-refresh>
                    <ordered>true</ordered>
                    </fill-method>
                    </server>
                    </properties>
                    </destination>


                    C:\fds2\jrun4\servers\default\samples\WEB-INF\flex\services-config.xml

                    <!-- ColdFusion specific RTMP channel -->
                    <channel-definition id="cf-dataservice-rtmp" class="mx.messaging.channels.RTMPChannel">
                    <endpoint uri="rtmp://{server.name}:2048" class="flex.messaging.endpoints.RTMPEndpoint"/>
                    <properties>
                    <idle-timeout-minutes>20</idle-timeout-minutes>
                    <serialization>
                    <!-- This must be turned off for any CF channel -->
                    <instantiate-types>false</instantiate-types>
                    </serialization>
                    </properties>
                    </channel-definition>

                    <!-- ColdFusion specific HTTP channel -->
                    <channel-definition id="cf-polling-amf" class="mx.messaging.channels.AMFChannel">
                    <endpoint uri=" http://{server.name}:{server.port}/{context.root}/messagebroker/cfamfpolling" class="flex.messaging.endpoints.AMFEndpoint"/>
                    <properties>
                    <serialization>
                    <!-- This must be turned off for any CF channel -->
                    <instantiate-types>false</instantiate-types>
                    </serialization>
                    <polling-enabled>true</polling-enabled>
                    <polling-interval-seconds>8</polling-interval-seconds>
                    </properties>
                    </channel-definition>

                    <pattern>DataService.coldfusion</pattern>



                    CFCs are located at: C:\CFusionMX7\wwwroot\samples\contact
                    mappings: /samples C:\CFusionMX7\wwwroot\samples
                    http://localhost:8500/samples/contact/testContactAssembler.cfm is showing data returned.

                    Flex app is at: http://localhost:8700/samples/dataservice/cfcontact/contactmgr.mxml

                    My application files are at: C:\fds2\jrun4\servers\default\samples\dataservice\cfcontact

                    updated contactmgr.mxml with ds = new DataService("cfcontact");
                    ------------------------------------------------------------------------------------------ -------------

                    Thanks for any ideas!!!
                    • 7. Re: &quot;Using ColdFusion with Flex&quot; samples dont work!
                      jpesolutions
                      I am getting this error

                      Compilation Results

                      Errors, warnings or exceptions were found while compiling /contact_sample/dataservice/contact/contactmgr.mxml. Visit the online Flex documentation or API reference for further information.



                      1 Exception found.

                      Exception flex.messaging.config.ConfigurationException
                      Configuration error encountered on line 94, column 7: 'The element type "services-config" must be terminated by the matching end-tag "</services-config>".'

                      Any Ideas? I can't find the unterminated element.
                      • 8. Re: &quot;Using ColdFusion with Flex&quot; samples dont work!
                        hkk
                        hi,

                        i have teh same problem as "dr. goomba", but with the CRM sample.

                        i receive the error eror message:
                        "error invoking fill-method 'fill' for destination cfcompany: Permission denied"

                        coldfusion http://localhost
                        fds http://localhost:8700

                        i have changed all config files as described here:
                        www.adobe.com/devnet/flex/articles/coldfusionflex_part2_02.html

                        the console output does NOT display this infos:

                        [Flex] [CFDataServicesAdapter] Configuring CFC adapter for destination cfemployee
                        [Flex] [CFDataServicesAdapter] Configuring CFC adapter for destination cfcompany


                        thanks in advance
                        herbert
                        • 9. Re: &quot;Using ColdFusion with Flex&quot; samples dont work!
                          StevenErat Level 1
                          Before I discovered this forum thread, I fumbled through the application, but eventually figured out the various little problems with it. I blogged my annotations to the article here:
                          http://www.talkingtree.com/blog/index.cfm/2006/12/20/FDS-CFMX702-ContactManagerApp

                          In particular, I found that the most critical correction regards making the DataService creation match the same name used in the destination id for the Contact App destination.

                          quote:

                          23. Find this line of code: ds = new DataService("cfcontact");
                          24. Change cfcontact to cfcontact-default


                          The destination id already is "cfcontact" not "cfcontact-default", and by default the contactmgr.mxml initApp() method uses
                          ds = new DataService("cfcontact-default");
                          so that must be chnaged to
                          ds = new DataService("cfcontact");
                          to match the desintation id