10 Replies Latest reply on Dec 5, 2006 6:33 AM by Cliff Mosdall

    Why Can't I Flex and CF 7.0.2 Play Nicely??

    JennHysuick Level 1
      Ok - I've been worknig on this for days, and I can't get it to work. I have a Flex application running locally , but when I try to create the exact same app on my development server, I get this error:
      +++++
      [RPC Fault faultString="flex/messaging/io/amf/UnknownTypeException" 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$37:NetConnectionMessageResponder: :statusHandler()
      at mx.messaging::MessageResponder/status()
      ++++

      Here is the code I am using:
      +++++

      <mx:Application xmlns:mx=" http://www.adobe.com/2006/mxml" layout="absolute" creationComplete="init()">

      <mx:Script>
      <![CDATA[
      import mx.collections.ArrayCollection;
      import mx.rpc.events.ResultEvent;
      public function init():void
      { cfData.getData(); }

      public function displayResults(event:ResultEvent):void
      { newText.data = event.result as ArrayCollection; }
      ]]>
      </mx:Script>

      <mx:RemoteObject id="cfData" destination="ColdFusion" source="PleaseWork.com.simpleComponent">
      <mx:method name="getData" result="displayResults(event)"/>
      </mx:RemoteObject>

      <mx:Panel height="250" width="800" x="0" y="125"> <mx:Text id="newText"/> </mx:Panel>
      </mx:Application>
      +++++

      in the project properties, I have the following settings:
      - Flex Compiler: -services "V:\WEB-INF\flex\services-config.xml" -locale en_US
      - Flex Server/Flex root folder: V:\
      - Flex Server/Flex server URL: http://cf7:8301
      **V:\ is the mapped drive to the server**

      I've read the other posts on here about this topic, and I've tried those suggestions, but I still can't get this to work. Is there something I need to configure in the ColdFusion Administrator??

      Please Help!
      ~~Jenn~~
        • 1. Re: Why Can't I Flex and CF 7.0.2 Play Nicely??
          JennHysuick Level 1
          As adn add on, I am working on an instance of the coldfusion 7 server (which is why the port number is 8301 not 8300) - would this make a difference in how anything in the CFAdministrator would be configured?

          ~jenn
          • 2. Re: Why Can't I Flex and CF 7.0.2 Play Nicely??
            codeidiot
            I am having the same problem!!!!! I think I might go mad.

            Works great on my local machine...I try to move it to my dev server and I get a netconnection error. I too have tried every possible iteration of settings in my flex compiler, services-config.xml file both locally and remotely (still don't know which one needs to be configured...like documentation on that wouldn't be of any help).

            The only quirk I can mention is that my dev server has the "CFusionMX7" folder installed in the same root directory as my "Inetpub" that I have configured to host my sites.I have been thinking that it's a path issue all along but the config file requires dotted syntax from the "webroot"...I think that is the Coldfusion wwwroot "webroot" folder...not the "real" webroot. Therefore I am at a loss on how to remedy this situation, with out reconfiguring my servers entire layout just to post the single flex app I have built.

            With the "source" attribute in my RPC, the local and remote server-config.xml file settings, the disparate setup of a local maching verses a server that hosts a ton of sites...it's a miracle anybody has this stuff working correctly.

            JennFasthuber, any similarity here?
            • 4. Re: Why Can't I Flex and CF 7.0.2 Play Nicely??
              JennHysuick Level 1
              CodeIdiot,

              I feel your pain! I'm not too sure if it is a path issue - from what I can decipher of the "little bit" of documentation out there, what they refer to the webroot can change on every machine. The only thing I can see is that there has to be a WEB-INF folder in your webroot, and that folder has to have a Flex folder with the services-config.xml in it.

              What platform is your server running on? Ours is Unix based here, so that may be the part of the problem with how the directory structure is set up.

              I'm really hoping to get this figured out today - end the week with a Woo Hoo!

              Jenn
              • 5. Re: Why Can't I Flex and CF 7.0.2 Play Nicely??
                JennHysuick Level 1
                Peter,

                I've tried what the article says to do, but I'm still getting the same error message (which is a different one that the article talked about). The FaultString I'm getting is "flex/messaging/io/amf/UnknowTypeException" - and I have no idea what the problem is. I can connect to the server, I can run basic Flex pages, but as soon as I try to hit a CFC, I get this same message.

                I'm not even sure if I'm creating the project correctly. I'm working on Windows, the CF7 server is Unix (hich is a virtual server running on a shared machine) and I have a drive mapped to my instance of the server and it is in this "mapped" drive where I keep my project code and work on it. When I create a new project, I create a ColdFusion Flas Remoting service project, set the root folder to my mapped drive, the root URL to http://server:port, give the project a name, and put the contents in the "mappedDrive:\projectname" folder (the drive is mapped right to the webroot). In the properties, I have "-services "V:\WEB-INF\flex\services-config.xml" -locale en_US" as my compiler arguments, and my server is set up as it was when I created the project.

                If I put up just a simple <mx:text> item, everything is fine, it's only when I try to call a CFC that I get the message. What am I doing wrong, or am I just missing something, or is my code wrong (but the code does work properly when I run it on my //localhost:8500).

                This is so frustrating!

                Jenn
                • 6. Re: Why Can't I Flex and CF 7.0.2 Play Nicely??
                  Renaun_Erickson
                  Make a CFM with this code in it:
                  <cfinvoke method="getData"
                  component="PleaseWork.com.simpleComponent"
                  returnvariable="result">

                  <cfdump var="#result#">
                  <cfabort>

                  Make sure your CFC is working correctly. If so then its definitely in the Flex/ColdFusion connectivity area.
                  • 7. Re: Why Can't I Flex and CF 7.0.2 Play Nicely??
                    peterent Level 2
                    Yes, make sure a CFM run from your system will work.

                    I also don't see that the CF server you are hitting is 7.0.2 which contains the Flex connectivity update. I know you've specified the location of the services-config.xml file, but is it really there and does it have a destination named "ColdFusion"?
                    • 8. Re: Why Can't I Flex and CF 7.0.2 Play Nicely??
                      JennHysuick Level 1
                      I ran the CFM from my server, and the component worked, so it must be a connection/config issue.

                      The server version is 7.0.2.142559, and the destination in the services-config.xml file is ColdFusion - I haven't made any changes to that file. It's the UnknownTypeException error that I keep getting that has me really perplexed! Would it have something to do with the JVM or the runtime (something someone mentioned to me the other day). Not having installed the server myself, i don't understand all the settings in the Adminitrator.

                      Thanks for the suggestions!
                      • 9. Why Can't I Flex and CF 7.0.2 Play Nicely??
                        feiy
                        the is a bug of coldfusion 7.02 in redhat,u can fixed it by:
                        <code>
                        wget http://labs.eshangrao.com/flex/2/flex-messaging-patch-byFeiy.jar
                        cp flex-messaging-patch-byFeiy.jar \
                        $coldfusion/servers/cfusion/cfusion-ear/cfusion-war/WEB-INF/cfusion/lib/
                        </code>
                        than restart the coldfusion server.
                        everything is ok!
                        enjoy

                        the more info view: http://blog.eshangrao.com/index.php/2006/12/03/303-redhatflash-remotingcfcunknowntypeexcep tion
                        • 10. Re: Why Can't I Flex and CF 7.0.2 Play Nicely??
                          Cliff Mosdall Level 1
                          It looks like the only serious (working) application that demonstrates Flex/Coldfusion connectivity is the mytodolist, which can be found at afusion.com

                          I downloaded it and got it running. I then tried modifying it to make a new application.
                          So far I’ve wasted nearly 2 days. If I change the definition of the public dynamic class
                          That is used to pass data between Flex/CF the app says “return type of routine GetAll() is not of type Task”
                          Once Flex displays that error – it NEVER goes away, even if you change the source back to what it was and CLEAR (rebuild the app).
                          It seems to me that Flex 2 is pretty much full of bugs.