2 Replies Latest reply on Feb 1, 2008 10:23 AM by ProjectedSurplus

    Flex and ColdFusion

    ProjectedSurplus Level 1
      I have installed CFusion 8 on a NETWORK machine that seems to have IIS running. I can ping said machine from itself at 127.0.0.1 (but not any :port) and from a network connected machine (which has flex installed on it) at 192.168.1.14:8300

      On the CFusion machine I have gone through the myriad and confusion setup procedures at Adobe.com. I also have registered a database with it that the CFusion Administrator reports as Status OK.

      On my Flex machine in Flex 2 >> Preferences >> RDS Configuration I can successfully test a connection to 192.168.1.14 Port Number 8300

      However, when I try to follow the examples at Adobe.com and in Flex 2 go New >> Other >> ColdFusion Wizards >> CF/Flex App Wizard >> . . . >>

      the RDS Server shows up but nothing is available in the drop down for Default Data Source. Per the instructions I've revisited both the RDS Server Settings and the registered Data Sources, but each check out fine.


      Further I'm really lost regarding what New >> Flex Project >> CFusion FRS is vis a vis the Flex Data Services AND what my webroot is or root folder, or root URL or ???????????

      Any suggestions where to start?
        • 1. Re: Flex and ColdFusion
          Ratsnackbar Level 2
          As it is on port 8300 it sounds like you performed a JRun install and used the built in ColdFusion web server. I would not recommend doing that. I would suggest installing Apache or configuring IIS. Then reinstall ColdFusion and chose to run the web server connector. That way you can have it running on the standard port 80. If you do not like IIS, Apache for Windows in version 2.2.6 also has OpenSSL built in if you wanted to test with SSL.

          When you get to the point where it asks you to choose the web root if it is not actually pointing to your wwwroot (htdocs for apache) directory make sure to point it there as this is where it will install your CFIDE directory and it is handy to have that in your web root rather then having to remap it later.

          Make sure that when it prompts you to set a password for the RDS that you do. You will need it for flex builder.

          Sounds like you have already figured out how to create a DSN so I will skip that. Just make sure that they validate.

          Once all that is done I suggest one other thing. Flex needs access to the services-config.xml file to compile. You will hear lots of advice about copying it over to your local system in a fake directory. I find it better to share out the directory it is in on the server and then point FlexBuilder to that directory. That path is C:\ColdFusion8\wwwroot\WEB-INF\flex\services-config.xml by default. But you will want to just share out the ColdFusion8 Folder itself.

          Then share out your webroot. For IIS I believe that is just c:\wwwroot. Just share the folder under the same name is fine.

          Make sure you can get to each of the folders over the network using their UNC paths. The reason for this will become clear later. Or at least less foggy.

          Once all that is done move to your Development workstation. Open a command prompt and make sure that you can ping your server by Name. IP addresses are ok but it is better to use the name in my opinion. If you do not have local DNS resolving names you can configure your systems Hosts file to point to that servers IP address for any given web URL you would like.

          On your workstation when you install flex builder make sure to choose to install the ColdFusion Extensions for FlexBuilder.

          Then open flex builder. I use Flex Builder 3 Beta 3 so if you are using version 2.01 your screens will differ.

          Click File > New > Flex Project

          Provide a project name. Anything is fine for now this is just a test.
          Example: mycoolnewflexsite

          Choose the default location for the workspace or choose another location. It does not really matter where you put the workspace. Just don't forget where you put it if you change it's default location. Your workspace is not the same as your WebRoot. The Work space is Flex's location where it keeps your configuration information about your projects and it's UN-Compiled source files.

          Choose ColdFusion for the server technology and Select ColdFusion Flash Remoting for this instance.
          Click next.

          On the next screen it is going to ask you which installation type. My install uses a standalone server. Sounds like yours is JRun which I believe means you have to choose Deployed to J2EE. You will want to look that up. Either way there is not too much difference in the screens.

          For the standalone these are the settings I use.

          UNCHECK the "Use default location for local ColdFusion server".
          In the field put in the UNC path to the shared ColdFusion8 Folder on our development server.
          Example: \\MyServerName\ColdFusion8

          This way FlexBuilder has access to that services-config.xml we were talking about through the UNC path. No need to copy it over to your workstation and you can keep it consistant amongst developers this way.

          Uncheck the Use built-in ColdFusion web server
          for the Web root use the shared webroot from your server you shared out above and the name of the root file for your sites folder inside that shared directory.
          Example: \\MyServerName\wwwroot\MyCoolNewFlexSite

          For the Root URL you will want the actual URL that you will be using to get to your website. http://www.mycoolnewflexsite.com (Again your DNS should be pointing to your local development servers ip address and not the real world web address for your site. If you do not have DNS running in your network then use your local workstations Hosts file to simulate the same thing.)

          Down below that will be a field called "Output folder". This is where flex is going to put the files that it Compiles. For this you will want to have the same exact path as the Web Root. It may already be in there with a debug folder attached to the end. I prefer to take off the debug folder and just make it exactly the same as my web root path.

          By using the UNC paths instead of local files this allows FlexBuilder to compile directly to the servers wwwroot directory you will be testing the files from. No need to transfer the compiled files this way. Might not make your network admin happy but you will have at least two weeks before your network admin can figure out where the extra traffic is coming from and then only if they are well above average. And trust me I know wherefore I speak about network admins. Odds are they will never figure it out and if they do it just gives you reason to have them install a gigabit switch and hook you up to the server at a faster pace. It's part of the work requirements RIGHT?!

          OK so after you have those paths in place click on validate configuration. You may get a warning about there already bing a bin directory but just ignore that and move on.
          click next.

          On the next screen for the main source folder I prefer to erase the default src it uses. That's up to you.

          For the main application mxml file just use whatever is there for now. You can always change it later.

          For the Output folder URL change it to the URL of your site. I.E. http://www.mycoolnewflexsite.com

          Then click finish.

          FlexBuilder will open up your applications main MXML file. To test if it is working you should be able to just add in a text line and click the compile button.

          <?xml version="1.0" encoding="utf-8"?>
          <mx:Application xmlns:mx=" http://www.adobe.com/2006/mxml" layout="absolute">
          <mx:Text id="hw" text="Hello World!" />
          </mx:Application>

          If all goes well it will pop open your browser to the URL from your development server with your compiled Hello World displayed. If you get that far you are almost home.

          Still a bit more though.

          So once this is cone click on Window > Preferences and then click the + next to ColdFusion and click RDS Configuration.

          In the RDS configuration highlight localhost and just click remove.
          Then click new button.
          For Description put in the Name of your development server.
          For the Host Name also put in the name of your development server
          For the port choose port 80 (Assuming you set up IIS or Apache as recommended.)

          Assuming you have not yet set up multiple users in ColdFusion Administrator then your User Name is going to be simply "admin".
          Put in your password you set up for the RDS password when you were installing ColdFusion Server.

          Click on Test Connection. If it tests out then you will have just completed your install. The Test Debugger will not work until you turn on Debugging in the ColdFusion server Administrator. I will let you figure that out on your own as I am getting tired of typing.

          I realize that's a lot but once you have done it 3 or 4 hundred times it becomes second nature.

          Hope that helped and did not muddy the waters. I realized as I was typing that this really is not a good explanation without pictures. Next time I do a development install I will have to take screen shots I guess.
          - Joe
          • 2. Re: Flex and ColdFusion
            ProjectedSurplus Level 1
            Thanks ever so much, I will go through what you outline but regardless I couldn't have asked for any more than the extensive effort you put in. Hope I can repay you sometime.