8 Replies Latest reply on Jul 9, 2009 2:57 PM by bigredsound1

    Issue modeling data from Coldfusion cfc

    bigredsound1

      Problem:  Configure return type in  Flash Builder  (using with Coldfusion) Mysql 5 driver (testing using localhost with CF also acting as the web server)

      I have tried going thru the steps presented in the video presentations for hooking Flash Builder to Coldfusion query data.  I provide a name for a Custom data type, provide variables (that are optionally required by the CFC), and then proceed.  The operation comes back with the following message.

       

      The operation returned a response of the type "Object"
      You may either update server code to fix the return data or CLICK OK to set "Objecdt" as the returntype of this operation

       

      In all of the videos I have watched, Flash Builder auto-magically introspected the table that was being called and knew the data types of  each piece of the data returned by the  query. In my case, I get the above message and cannot proceed.

       

      CFM Testing

      I have tested the query by calling the CFC method via a coldfusion page and dumping the result.  Everything is works with that.

       

       

      Action:

       

      I would like to get past the problem and learn what if anything I am doing wrong with this.  Your input is appreciated.  I have been learning CF and am getting pretty comfortable with that product. I would like to move forward with Flash Builder. I have some basic knowledge of Flex 3.

       

      Thanks for your help

       

       

      Background:

       

      CFC signature

       

          <cffunction name="getJewels" access="remote" returntype="any">
              <cfargument name="jType" type="string" required="no" />
              <cfargument name="jActive" type="boolean" required="no" />
              <cfargument name="jOrder" type="boolean" required="no" />

       

      Report generated on Jul 08, 2009 11:07 AM

       

      This report shows the status of all ColdFusion configuration settings. To display the area of the ColdFusion Administrator where you can edit the group settings, click any of the groups in the report.

       

       

      Version Information
      Server Details
      Server ProductColdFusion
      Version8,0,0,176276
      EditionDeveloper
      Serial Number
      Operating SystemWindows XP
      OS Version5.1
      Adobe Driver Version3.6 (Build 0017)

       

       

       

      JVM Details
      Java Version1.6.0_01
      Java VendorSun Microsystems Inc.
      Java Vendor URLhttp://java.sun.com/
      Java HomeC:\ColdFusion8\runtime\jre
      Java File EncodingCp1252
      Java Default Localeen_US
      File Separator\
      Path Separator;
      Line SeparatorChr(13)
      User NameSYSTEM
      User HomeC:\
      User DirC:\ColdFusion8\runtime\bin
      Java VM Specification Version1.0
      Java VM Specification VendorSun Microsystems Inc.
      Java VM Specification NameJava Virtual Machine Specification
      Java VM Version1.6.0_01-b06
      Java VM VendorSun Microsystems Inc.
      Java VM NameJava HotSpot(TM) Server VM
      Java Specification Version1.6
      Java Specification VendorSun Microsystems Inc.
      Java Specification NameJava Platform API Specification
      Java Class Version50.0

       

      This is the dataset I am trying to get at.

       

      dstones
      CF data source namedstones
      DescriptionDancing stones databases
      DriverMySQL5
      JDBC URLjdbc:mysql://localhost:3306/hmsollie?
      Usernameroot
      Login timeout30  seconds
      Long text buffer size64000
      Timeout1200  seconds
      Maintain connectionsYes
      Interval420  seconds
      Restricted SQL operations
      Disable connectionsNo

       



      Lets a Flash client connect to this ColdFusion server and invoke ColdFusion Components (CFCs).                NOTE: Disabling this feature also disables ColdFusion server monitoring and multiserver monitoring.


      Lets LiveCycle Data Services ES connect to this ColdFusion server through RMI                and use CFCs to read and update data that supports a                Flex application. If you are not using this feature, disable it.                This does not affect LiveCycle Data Services ES integrated in to the ColdFusion installation.

       

      Server Identity:

      If you are running more than one instance of ColdFusion on this machine, you must           configure each instance with a unique ID.

      Full path to keystore:
      Keystore password:

       

      Select IP addresses where LiveCycle Data Services are running
      To secure the LiveCycle Data Services ES integration point, the hosts that are allowed to perform Data Management operations are restricted. If you are running LiveCycle Data Services ES on a different computer, specify its IP address here. By default, only the local computer can perform Data Management operations in ColdFusion.

       

       

       

        • 1. Re: Issue modeling data from Coldfusion cfc
          bigredsound1 Level 1

          I added a PDF with the screens in my initial post.

           

          This is the same error as in the post

           

          Error on Configure Operation Return Type

          by

          Jeff_Self

          • 2. Re: Issue modeling data from Coldfusion cfc
            hneelu Adobe Employee

            Do you have a function with returns the same data, but does not take any input argument. (Something like getAllItems() )

            Is the same reproduced for that too ?

             

            Also, can you verify that if the code contains an if statement which is failing?

            • 3. Re: Issue modeling data from Coldfusion cfc
              SunilAdobe Adobe Employee

              The message box comes when the returned object from the cfc does not have any properties.

              If you querying a database for the given input parameters, there might not be any record matching that and it can be resulting in an empty object without any properties. Can you check this.

               

              As a workaround and to isolate the problem, just try returning a hardcoded object something like this in your function.

               

              <cfset stJewel=structNew()>
              <cfset stJewel.id=1>
              <cfset stJewel.type="Gold">
              <cfreturn stJewel>

               

              Hope this helps.

              • 4. Re: Issue modeling data from Coldfusion cfc
                bigredsound1 Level 1

                Sunil,

                      It is returning a query.  I thought this was suppose to introspect the table via RDS and figure out the columns to be returned.

                • 5. Re: Issue modeling data from Coldfusion cfc
                  bigredsound1 Level 1

                  No If statements are failing.  I have tested this with calling the method from a cfm file that gets the query return from the method in the CFC and dumps the query.

                   

                    I will create a getAllItems()  method that has a real generic query.  If I need to create a model for the data another way, let me know.  I thought that the connection to RDS would go out and see the datasource -> table and gather the columns to be used as the data model.

                   


                  I will get back to you with results in a bit.

                   

                  Thanks.

                  • 6. Re: Issue modeling data from Coldfusion cfc
                    SunilAdobe Adobe Employee

                    Configure Return Type actually executes the remote function and based on the result tries to guess the return type. In your case, when it executed the function with the parameters, it probably did not get any result from that query. However you could expect the following in a future drop

                     

                    a. A more intuitive interface for the Configure Return Type feature

                    b. Introspect the columns of a table and generate a sample cfc file using RDS

                    • 7. Re: Issue modeling data from Coldfusion cfc
                      bigredsound1 Level 1

                      I will try using a real generic method and see what happens. No input arguments.  I will get back to you.

                       

                      Thanks.

                      • 8. Re: Issue modeling data from Coldfusion cfc
                        bigredsound1 Level 1

                        Sunil,

                             I have found the problem. When initialy given the arguments list to fill in "Configure Return Type", I filled in a string argument as "E".  This gives a return of object.  To accurately use the Configure Return Type, I needed to just fill in a string as E.

                         

                        See the Screen Prints on the error

                         

                        I have tested the following functionality and it appears to work ok

                        1.  I have tested with no parms to the CFC query method

                        2. I have tested  using Dynamic SQL based on variables set before the query in a  CFC method

                        3. I have tested passing one string argument in from Flash Builder  to a CFC method

                        4. I have tested passing a string and boolean argument From Flash Builder to a CFC method

                         

                        For 3 and 4, I had make some slight changes o set the arguments that were being sent to CFC in Flash Builder before the call

                         

                        It all worked.

                         

                        **** New Issue ***

                        I have another runtime issue involving states that I uncovered in my testing where buttons are the screen were being covered up when I used some of the DataGrid Controls.  If I can repeat it, I will post it and then let you guys let me know how to work around this.

                         

                        I am a Flex/AS Novice, so I may be mis-understanding something on this new issue.

                         

                        Thanks.