8 Replies Latest reply on May 7, 2007 11:01 AM by BLXWebMaster

    RemoteObject() connectivity

    kikanshathomas
      I'm a Flex newbie.. I followed a great tutorial to develop a Flex app using cfc's. Here is the video: Click Here. However once I completed everything and tryied to run the application I keept getting this error:
      [RPC Fault faultString="Send failed" faultCode="Client.Error.MessageSend" faultDetail="Channel.Connect.Failed error NetConnection.Call.Failed: HTTP: Status 405: url: ' http://localhost/flex/messagebroker/amf'"
      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()

      Not sure what I need to do, I'm guessing it's some configuration error. Has anybody come across the and has a simple solution for it.
        • 1. Re: RemoteObject() connectivity
          knallore_adobe Level 1
          Verify that flex has started up propely. Check the logs to see if there are any errors.

          Also, try to browse to the URL in the error to see it throws any exceptions.

          HTH
          Kumaran
          • 2. Re: RemoteObject() connectivity
            skypuddle
            Hello,

            I too experience the same HTTP: Status 405 error when trying to access cfc's. What do you mean by verifying flex has started up properly? I have been working on trying to get this resolved for the passed two weeks. Our configuration consists of ColdFusion Enterprise 7.02 installed as multiserver, which goes against all of the threads I have read in trying to resolve the issue. I have included the services-config.xml compiler statement and even changed the contents to specifically access [ http://mydomain.com/flex2gateway In all cases, leaving the services-config.xml in original form or specifying specific endpoint, I still get the same 405 error although the proper path is displayed in the error message (i.e. [ http://mydomain.com/flex2gateway I am compiling the application directly to the server via drive letter mappings to make sure the environment is included in the build. The entire application is hosted on one server, so I shouldn't have to specifically state an endpoint right? I have tried to get this to work on both our test and production server and continue to experience the same error, which leads me to believe there is a configuration issue. I'm not quite sure how the flex2gateway is setup? Is there something that has to be setup in the jrun administration? In looking at the jrun cfusion logs, the only error message I see is: "43 error There is no web application configured to service your request " , which was generated when I upgraded CF to 7.02. So does my problem result from the upgrade? Both servers had the same .exe applied. But the install displayed the process executed successfully. There are no errors in the ColdFusion administration log files. Also, production has JVM 1.4.2_09 and I upgraded test to 1.4.2_14 just to see if that was the problem. I am really at wits end on trying to find a resolution. Any helpful information is extremely appreciated! Thanks!
            • 3. Re: RemoteObject() connectivity
              BLXWebMaster Level 1
              I have experienced a similar error and determined it was because of my Context Root. Check your Flex Project properties and verify that the Flex Server Context Root is blank, unless you are sure you are using this feature.

              • 4. Re: RemoteObject() connectivity
                skypuddle Level 1
                Yes, I have made sure the Context Root is blank. I am not very clear on when the Context Root would ever be used. Maybe it should be something and I just don't know what that is! I am just puzzled on the flex2gateway reference and how all that works!

                I forgot to mention in my original post that the webserver is IIS 6. Do I need to add a script mapping or something? In the romoteobject definition source="" includes the full directory path (dot notation) from the webserver root, which is c:\inetpub\wwwroot. Maybe IIS is the culprit not configured in the mix?

                Thanks for your reply!
                • 5. Re: RemoteObject() connectivity
                  BLXWebMaster Level 1
                  First,

                  Can you browse to http://localhost/flex/messagebroker/amf? You shoudl get a blank page. If you cannot, there is an issue. I would be interested to see your services-config.xml file.

                  This might help. http://www.adobeshare.net/cfusion/webforums/forum/messageview.cfm?forumid=60&catid=583&thr eadid=1185403&enterthread=y

                  Normally when using Cold Fusion 7.02, your flex.messaging.endpoints.AMFEndpoint would use the flex2gateway.

                  This should be in your services-config.xml file.
                  <channels>
                  <channel-definition id="my-cfamf" class="mx.messaging.channels.AMFChannel">
                  <endpoint uri=" http://{server.name}:{server.port}{context.root}/flex2gateway/" class="flex.messaging.endpoints.AMFEndpoint"/>
                  <properties>
                  <polling-enabled>false</polling-enabled>
                  <serialization>
                  <instantiate-types>false</instantiate-types>
                  </serialization>
                  </properties>
                  </channel-definition>
                  </channels>

                  If it does not, make sure y ou are running the lastes Flex 2 and CF 7.02.

                  • 6. Re: RemoteObject() connectivity
                    skypuddle Level 1
                    No, I cannot browse to http://[domain.com 404 error: page cannot be found. (I believe this to be my problem!) Would this have something to do with IIS? The [domain.com] is the public domain configured in IIS to access the flex application. I just think I am missing something in the configuration to direct to IIS....I have not manually done anything to make this happen. Any thoughts?

                    Here is my services-config.xml file contents, which matches what you stated:

                    <?xml version="1.0" encoding="UTF-8"?>
                    <services-config>
                    <services>
                    <service id="coldfusion-flashremoting-service"
                    class="flex.messaging.services.RemotingService"
                    messageTypes="flex.messaging.messages.RemotingMessage">
                    <adapters>
                    <adapter-definition id="cf-object" class="coldfusion.flash.messaging.ColdFusionAdapter" default="true"/>
                    </adapters>
                    <destination id="ColdFusion">
                    <channels>
                    <channel ref="my-cfamf"/>
                    </channels>
                    <properties>
                    <source>*</source>
                    <!-- define the resolution rules and access level of the cfc being invoked -->
                    <access>
                    <!-- Use the ColdFusion mappings to find CFCs, by default only CFC files under your webroot can be found. -->
                    <use-mappings>false</use-mappings>
                    <!-- allow "public and remote" or just "remote" methods to be invoked -->
                    <method-access-level>remote</method-access-level>
                    </access>
                    <property-case>
                    <!-- cfc property names -->
                    <force-cfc-lowercase>false</force-cfc-lowercase>
                    <!-- Query column names -->
                    <force-query-lowercase>false</force-query-lowercase>
                    <!-- struct keys -->
                    <force-struct-lowercase>false</force-struct-lowercase>
                    </property-case>
                    </properties>
                    </destination>
                    </service>
                    </services>
                    <channels>
                    <channel-definition id="my-cfamf" class="mx.messaging.channels.AMFChannel">
                    <endpoint uri=" http://{server.name}:{server.port}{context.root}/flex2gateway/" class="flex.messaging.endpoints.AMFEndpoint"/>
                    <properties>
                    <polling-enabled>false</polling-enabled>
                    <serialization>
                    <instantiate-types>false</instantiate-types>
                    </serialization>
                    </properties>
                    </channel-definition>
                    </channels>
                    <logging>
                    <target class="flex.messaging.log.ConsoleTarget" level="Error">
                    <properties>
                    <prefix>[Flex] </prefix>
                    <includeDate>false</includeDate>
                    <includeTime>false</includeTime>
                    <includeLevel>false</includeLevel>
                    <includeCategory>false</includeCategory>
                    </properties>
                    <filters>
                    <pattern>Endpoint.*</pattern>
                    <pattern>Service.*</pattern>
                    <pattern>Configuration</pattern>
                    <pattern>Message.*</pattern>
                    </filters>
                    </target>
                    </logging>
                    <system>
                    </system>
                    </services-config>
                    • 7. Re: RemoteObject() connectivity
                      skypuddle Level 1
                      Another clarification, Flex Data Services is not installed. I'm just trying to access .cfc components. Everything works fine locally on my laptop (using FlexBuilder 2, ColdFusion 7.02). The only difference is I am using the built in webserver (127.0.0.1:8300) instead of IIS. Should I be able to execute http://127.0.0.1:8300/flex/messagebroker/amf? If so, I get the same 404 error, which totally confuses me on why local works, but test and production don't. Once again the only difference between local (which works) and test/production (that do not) is the webserver used (internal ColdFusion vs. IIS). Does this help any?
                      • 8. Re: RemoteObject() connectivity
                        BLXWebMaster Level 1
                        Well at least I think you found the root of your problem.

                        Yes, you should be able to browse to http://127.0.0.1:8300/flex/messagebroker/amf. This should display a blank page, not a 404. So, the problem is in your installation or IIS or configuration.

                        Are you sure you are using port 8300? For default CF installation I believe it is 8500. If you are using IIS, it should be 80.

                        So, just figure the right port to get the blank page.
                        Try 8500, 80, and also just http://127.0.0.1/flex/messagebroker/amf. Also try using the actual IP address fo your production server.

                        Once you get the blank page, you can modify your config XML file or override it in your code by modifying your RO object in your Component by adding endpoint=" http://127.0.0.1/flex/messagebroker/amf" with the correct port.

                        ALlen