This content has been marked as final. Show 15 replies
You have to set up the Coldfusion destination in the remoting-config.xml inside your coldfusion installation
This is was remoting-config looks like:
<?xml version="1.0" encoding="UTF-8"?>
<adapter-definition id="cf-object" class="coldfusion.flash.messaging.ColdFusionAdapter" default="true"/>
<adapter-definition id="java-object" class="flex.messaging.services.remoting.adapters.JavaAdapter"/>
<!-- define the resolution rules and access level of the cfc being invoked -->
<!-- Use the ColdFusion mappings to find CFCs, by default only CFC files under your webroot can be found. -->
<!-- allow "public and remote" or just "remote" methods to be invoked -->
<!-- cfc property names -->
<!-- Query column names -->
<!-- struct keys -->
Personally for a str8 forward app such as your testing I have never had to even peek at the remoting-config file but know many people may do.
Make sure that you have set up the Flex project to use ColdFusion and that the Flex compiler options have the correct arguments that point to your services-config file located in your CF root/WEB-INF/flex/ directory.
Next check that the gateway is functioning correctly by entering this url (or whatever steers to your cf root) and it should return a blank white page:
Lastly for your remote object source string if your flex app is NOT in your cf root try:
Okay, I had been creating my projects as basic projects. So I created a new project as a CF remote.
I also changed the source to reflect the flexclasses subfolder.
But when I go to http://localhost:8501/flex2gateway/ I get a 404 error. What is interesting is that if I go to http://localhost:8500/flex2gateway/ I get the blank page I am suppose to get. Port 8500 is my CF8 installation.
Can I have a gateway for both CF 7and CF 8 on the same machine?
Bad memories coming back :) not sure on that one but recall issues, memory aint what it used to be!
For the mean time dude check the flex app works in the cf root that seems to be functioning correctly.
if I'm not wrong I think that in cf 7.02 you have to define the gateway manually. You just create an empty cfc place it in your www server root and then define and flex2gateway in the gateway configuration.
Okay I thought I would be tricky and create a new CF project in CF8. I did that. Then I moved the cfc folder over along with the crossdomain.xml
So now the project is located at C:\ColdFusion8\wwwroot\testCFC\ with the testCFC.mxml file located in the src subfolder.
Now when I run the testCFC.mxml file I get this error:
[RPC Fault faultString="Unable to invoke CFC - Could not find the ColdFusion Component or Interface testVar." faultCode="Server.Processing" faultDetail="For details, turn on Robust Exception Information in the ColdFusion Administrator"]
The source for the RemoteObject is "testVar" because I moved the CFC into the src folder next to the testCFC.mxml file. I originally had the cfc in the 'cfc' subfolder and I got the same error message.
This is what my MXML file looks like now:
<?xml version="1.0" encoding="utf-8"?>
<mx:Application xmlns:mx=" http://www.adobe.com/2006/mxml"
<mx:Canvas width="80%" height="80%" backgroundColor="blue" backgroundAlpha="0.17" cornerRadius="0">
<mx:Panel width="217" height="205" x="106.5" y="156">
It feels like I should be close, but there always seems to be another issue along the way.
now it's simpler in flex in your remote object set the source to the cfc full path from the webroot each level separated for a dot.
I think your source should be something like source="testCFC.src.testVar"
Updated the source and I still get the same error message (updated with the new source).
[RPC Fault faultString="Unable to invoke CFC - Could not find the ColdFusion Component or Interface testCFC.src.testVar." faultCode="Server.Processing" faultDetail="For details, turn on Robust Exception Information in the ColdFusion Administrator"]
at mx.rpc::AbstractInvoker/ http://www.adobe.com/2006/flex/mx/internal::faultHandler()[E:\dev\3.0.x\frameworks\project s\rpc\src\mx\rpc\AbstractInvoker.as:216
at mx.rpc::Responder/fault()[E:\dev\3.0.x\frameworks\projects\rpc\src\mx\rpc\Responder.as:49 ]
at mx.rpc::AsyncRequest/fault()[E:\dev\3.0.x\frameworks\projects\rpc\src\mx\rpc\AsyncRequest .as:103]
at NetConnectionMessageResponder/statusHandler()[E:\dev\3.0.x\frameworks\projects\rpc\src\mx \messaging\channels\NetConnectionChannel.as:523]
at mx.messaging::MessageResponder/status()[E:\dev\3.0.x\frameworks\projects\rpc\src\mx\messa ging\MessageResponder.as:222]
This is a perft tutorial to get things up and running, try downloading the source and seeing how you get on, just as reassurance, do a google search for you issues and you will see that so many others have has similar issues with flex and cf: http://www.adobe.com/devnet/flex/articles/helloworld.html
spacehog tell me where is located your cfc it should be something like c:\coldfusion8\wwwroot\testva...
I'll have to look into this some more. I just tried something else for S & G. I created a new project, called testDB along with an Access database that resides in a subfolder called 'db'. The database, named 'db' is simple just one table called 'people' with a data field called 'names'.
I used the the CF/Flex wizard to create a simple master page that would displaythe two names in the people table.
When I ran the app I got the same basic error:
errorID = 0
faultCode = "Server.Processing"
faultDetail = "For details, turn on Robust Exception Information in the ColdFusion Administrator"
faultString = "Unable to invoke CFC - Datasource dbtest could not be found."
message = "faultCode:Server.Processing faultString:'Unable to invoke CFC - Datasource dbtest could not be found.' faultDetail:'For details, turn on Robust Exception Information in the ColdFusion Administrator'"
name = "Error"
rootCause = (null)
This common "unable to invoke CFC" error is leading me to think that their is something wrong with the way my laptop is set up. I am going to try these examples on my home PC and see what happens. I have had success with the CF/Flex wizard on the home computer, so I will see what happens there.
BTW, I have tried the above tutorial and I always ran into errors.
The cfc is currently located in the same folder as the MXML file:
Did you set up the datasource in the coldfusion administrator?
mab: Yes the datasource was setup.
Good news! Last night I took the files home and tried them on my home PC (Dell XPS 710 with CF8 and Flexbuilder 3) and right off the bat the files work.
I am going to try them on another machine in my office that I will install just CF 7.0.2 and Flex to see if that works.
Not sure if there is a conflict with running both CF7 and CF 8 services together, but it looks like I will need to uninstall both versions of CF and reload.
Thanks guys for all your help yesterday.