Migrating to 2.0.1 With ColdFusion Extensions

Summary: If you’ve created projects with the 2.0.0 version of the ColdFusion Extensions for Flex Builder, you need to add -context-root "" to the additional compiler arguments in order to compile with 2.0.1.

The whole story: With the 2.0.1 compiler we’ve made a change intended to help users understand when they need to set a context root setting. That’s a setting that’s critical to set correctly in order for your Flex client services to work with a Flex Data Services or ColdFusion server.Previously we defaulted this setting to an empty string, which worked fine for simple, standalone ColdFusion installations, which completely hide the concept of a J2EE context root/path from you. However it was wrong for every other server case. This caused a lot of pain for FDS customers because their services would simply not work and there was no indication that the context root setting was the cause.So, for 2.01 we do the following:1) ColdFusion projects default the context root to an empty string, as before.2) All other projects produce a compiler error if the context root is not set, when needed.**The context root setting is needed whenever parsing a services-config.xml file that uses it as a variable, as do the default services-config.xml files that ship with FDS and ColdFusion.So, in theory everything should work as it did before for ColdFusion projects, projects that don’t use FDS or CF would be unaffected, and only FDS users would get this new, helpful compiler error. And in practice, yes, ColdFusion projects created with the main New Flex Project wizard work exactly the same without any migration steps.Except we missed one case. The ColdFusion Extensions, an optional install on top of Flex Builder, add another wizard called the “ColdFusion/Flex Application Wizard”, a.k.a. the CF SuperWizard. This guy does everything from creating the project to populating it with code that accesses your database backend via ColdFusion. Upon upgrading to 2.0.1, projects created with this CF SuperWizard in 2.0.0 will start producing this compile error:The services configuration includes a channel-definition ‘my-cfamf’ that has an endpoint with a context.root token but a context root has not been defined. Please specify a context-root compiler argument.To fix this, you’ll need to perform this small migration step on each SuperWizard-created project, either before or after you upgrade to 2.0.1:1. In Flex Builder, right-click the project in the navigator and select Properties.2. Select the Flex Compiler page.3. In the additional compiler arguments field, append this:-context-root ""Please note: Do not use an equals sign. The correct syntax is -context-root "", NOT -context-root="".One other note. If you are using a J2EE ColdFusion installation, that is, you selected a WAR/EAR install instead of a standalone “Server” install when you installed ColdFusion, then you will need to set the context root to the actual context root you deployed the ColdFusion WAR/EAR to, rather than an empty string. For example:-context-root "mycontextroot"So, sorry for the trouble ColdFusion Extensions users! We introduced this change rather late in the 2.0.1 release cycle and just missed this case. To be clear, this does not affect ColdFusion projects created with the main New Flex Project wizard, only those created via the CF/Flex Application Wizard in the CF Extensions that you must install separately.

3 Responses to Migrating to 2.0.1 With ColdFusion Extensions

  1. Gerd says:

    Hi,I just upgraded to 2.01 and now my cf wizard projects whether 2.0 or 2.01, won’t compile on the finish screen of the wizard. For exisiting projects created with the cf wizard I’ve appended -context-root “” to the flex compiler arguments just as you describe above. This does not work for me. Empty directories are created and thats it. I’m running coldfusion standard single server on IIS.Any help is appreciated. ThanksAlso what about new applications being created with the cf wizard. Since we can’t enter the compiler args via the wizard for new projects I assume we need to create the project first and set the args before running the wizard?Any help is appreciated. Thanks

  2. Adam Lehman says:

    Thanks for the fix. Can we get this rolled up into a TechNote?