This content has been marked as final. Show 5 replies
Thanks for the reply!
however, i already following that..
I am having the same problem.
Can someone tell me...
What is the RMI registry?
Where is it getting 'localhost' from?
How is 'destination=ColdFusionGateway' in C:\CFusionMX7\gateway\config\flex-messaging-gateway.cfg related to the destinations defined in C:\apache\Tomcat\server\webapps\contactmgr\WEB-INF\flex\data-management-config.xml
Re: pwp's questions - RMI is used by the CFDataServicesAdapter in FDS to communicate with the ColdFusion Message Gateway. This should be largely transparent to the user and you shouldn't need to modify this file to get this sample running. Note that the ColdFusion config for the message gateway at \gateway\config\flex-messaging-gateway.cfg does not relate to your destination configuration in the Flex samples/WEB-INF/flex/data-management-config.xml. Also, it assumes 'localhost' by default so this means Flex must be running on the same host as ColdFusion (but they can, of course, be on different ports... for example, I have two JRun servers setup on the one machine to run Flex and ColdFusion independently).
A question for you both - what version of ColdFusion are you running? I imagine it's 7.0.2 as a war file deployment? Have you checked that you have a /WEB-INF/flex directory in your ColdFusion deployment? Is there a services-config.xml and license.properties file in here? Do you see any status messages on ColdFusion startup about "Starting Adobe Flex Data Services 2 Express" in the app stdout logs?
I ran through the config and can see how these particularly tricky set of steps might be hard to get right. Let me show you waht I did to get it working...
Here's the files I added to my exploded deployment of FDS samples.war after unzipping the folder to the webroot:
I then looked in contactmgr.mxml and checked that the DataService was being constructed with the correct destination name. The Script block had the following line in the private initApp function:
ds = DataService("cfcontact-default");
but I noticed that this destination was different to the one that I had copied from the FDS example config /resources/config/data-management-config.xml to my samples/WEB-INF/flex/data-management-config.xml. That is, the resources config example had the destination id set to "cfcontact" but the contactmgr.mxml file expected it to be "cfcontact-default". Correcting either the config or the source so that they both matched fixed this problem.
I also ensured that the "coldfusion-dao" adapter-definition was added to my samples/WEB-INF/flex/data-management-config.xml file.
Next, I made sure that I copied the correct ColdFusion specific channel definitions from /resources/config/services-config.xml to my samples/WEB-INF/flex/services-config.xml. Be sure to only copy these channel defintions to the samples war and do not copy them to other war files (and not to coldfusion either) as these are intended to help the Flex client communicate to a ColdFusion endpoint. (Also note that the RTMP channel listens on a specific configured port so cutting and pasting channel definitions to other apps will cause collisions if the port is not first modified to be unique for those other apps).
I then deployed the ColdFusion specific files to my new ColdFusion 7.0.2 installation. The file structure at the webroot looked like this:
I then had to go into the administrator (also be sure to do this if you've just completed a fresh installation as it seems there are some remaining steps that setup CF on the first access to the admin) and create the data source for the MS Access DB file and also created a ColdFusion Mapping for /samples to point to the physical location of the ColdFusion web application /samples directory (this confused me at first as I made the mistake of deploying everything to the Flex samples war and pointed this mapping over to that /samples instead of to the ColdFusion /samples - my mistake).
I restarted both applications to be safe (though I believe only the Flex war needed to be restarted after modification to the configuration files)... and the contact sample compiled and ran correctly.
Just a little more info on the destination in ColdFusion's \gateway\config\flex-messaging-gateway.cfg - this is related to pushing messages from ColdFusion back to the Flex Messaging Service, so it is not related to either DataServices, nor this example.