Getting Flex 1.5 to run on ColdFusion 8 Enterprise

written by Geoff Bowers on Monday, 17 September, 2007 @ 02:04 PM

Recently tasked with getting Flex 1.5 serve up and running on ColdFusion 8 Enterprise with Apache web server. We encountered a few troubles along the way and thought we might jot down some of the issues we faced and what we did to solve them.

UPDATE: Looks like you can't get Flex 1.5 going on CF8 if you use Flash Remoting.  If the Flex application makes a Remoting call to the ColdFusion server then you have to upgrade the Flex app to Flex 2 or 3. ColdFusion 8 remoting supports AMF3 where Flex 1.5 only supports the older AMF0 remoting protocol. You can’t downgrade the remoting services of CF8 to use AMF0. There were many changes from Flex 1.5 to Flex 2.0, both in the API and functionality, so although upgrading can be easy, it may be a little challenging depending on the complexity of the existing Flex application.

Best option is to try and get CF7 deployed as an EAR file onto the CF8 JRUN installation and go from there. 

There are blog posts that cover the same process, but we found that there were a few details missing. The Adobe documentation (written for CFMX but still applicable for CF8) is your best starting point.

Here's a summary of the problems we had:

An error stating that the application was compiled using the Developer Version and had expired.

  • Make sure that the file in the flex directory has a valid serial number (i.e. SN=...)
  • Don't open the index.swf (or whatever), open the mxml

When you try to open the mxml file in the browser it just shows the code

  • This means that for some reason the flex server stuff isn't running

The xxx-out.log file for your server has ServletExceptions where 'flex.class.path' was not found

  • In my case this was because I hadn't copied everything I needed from the flex web.xml to the cfusion web.xml
  • Specifically the context-param for flex.class.path

When the swf loads a dialog opens asking where the debug server is. Local host or IP?

  • This happens when you have the debug flash player installed
  • In my case I went the easy route - I uninstalled the flash player and installed the normal version

Loading http://domain/ throws an error

  • In the JRun section of the Apache config (http.conf) make sure that the AddHandler directive has .mxml in its list of extensions
  • Make sure index.mxml is set up as an index using the DirectoryIndex directive

All credit to Blair McKenzie, Daemonite, for finally getting things going. We hope that saves someone some time!