Back our Angular 4 Book on Kickstarter.

Why doesn't Flex Remoting work with ColdFusion 10 and Apache Web Server?

I'm doing some maintenance on an AIR application with a ColdFusion backend. For testing purposes, I installed a brand new copy of ColdFusion 10 and Apache Web Server 2.2.

My first step was to test this new setup the Flex Remoting connection between ColdFusion and Flex. It was borked! The flex2remoting URL would return a 404. What was wrong? I do not remember having problems in the past. ColdFusion 10 introduced a new version of Flex Remoting, so maybe that was somehow the cause. There are a few people complaining about errors they've encountered. I tried all the fixes.

First, I tried tweaking ColdFusion's file, as described by my good friend Joseph. That didn't work for me. I found another suggestion which recommended commenting out some lines of ColdFusion's web.xml file. No luck there either. I went over all of ColdFusion's Flex Remoting Configs in an attempt to find something amiss, no luck.

I started grasping at straws and experimenting. I know that in IIS, there is a virtual directory called Jakarta which is a Java Mapping and helps Flex Remoting, among other things run. Does Apache have something similar and could the setup be wrong? Apparently the answer is yes! Open up the mod_jk.conf file. It was created when you used the ColdFusion Web Server Configuration Tool to configure the Apache web server. There are a bunch of 'jk' properties:

LoadModule jk_module "C:\ColdFusion10\config\wsconfig\1\"
JkWorkersFile "C:\ColdFusion10\config\wsconfig\1\"
JkMountFile "C:\ColdFusion10\config\wsconfig\1\"

As best I can tell this is the Apache equivalent of the Jakarta mapping in IIS. I started researching the different options around the module loading.

When using virtual hosts with Apache Web Server, the mappings do not trickle down. I added this command to my Apache config:

JkMountCopy All

And everything started working magically.

There are reports of similar problems with CF11. It is frustrating that problems like this still exist.

How to fix Exceeded limit of maxWarmingSearchers=4 in ColdFusion

A new old client approached me. I hadn't worked for them in a decade, and I suspect their code base is twice as old as that. Don't we all love looking at old code?

The site was built with ColdFusion and used ColdFusion's underlying search engine to search files on their site. Ten years ago, the search engine in ColdFusion was Verity and we could index sites using the cfindex tag. However, over time Verity was replaced with Solr. This inadvertently caused some issues when re-indexing their site.

The Problem

Their code to index the site was like this:

<cfindex action="update" collection="myCollection" type="file" key="someKey" urlPath="path" />

This was performed in a loop over all the new files in their site. Sometimes they did massive updates and the search indexing was failing.

The error was something like this:

Error opening new searcher.

Exceeded limit of maxWarmingSearchers=4, try again later

I set to work trying to fix it.

The Solution

If you search for this error you'll find a lot of information about the error and Solr; but none if it is particularly useful in the context of ColdFusion. The Solr engine is getting too many indexing requests and rejecting them. It took some experimentation, but I found a solution.

First, when you're indexing the site, add the autoCommit parameter to the tag and set it to false:

<cfindex action="update" collection="myCollection" type="file" key="someKey" urlPath="path" autocommit="false" />

This tells Solr to add the files to the search collection, but not to index them yet. After all the files have been added, perform a commit action:

<cfindex action="commit" collection="myCollection" />

Then all the files are indexed by the Solr engine at once. Discovering this was a bit tricky because the commit action is mentioned a few places in the documentation, but is not documented as a valid value for the action attribute of the cfindex tag.

After setting this up; everything worked great!

Why Won't ColdFusion 10 show my cfgraph on IIS 7.5?

I just spent half a day trying to figure out why ColdFusion 10 would not show my cfgraphs. I solved it, but not by the 'usual' means.

I have a production server locked down via the CF10 lockdown guide. It has been chugging along for a few years without any issues.

I was working on some code to generate some reports on some database data. Everything was working fine on my local install of the code; but when I pushed to production my graphs were blank.

The graph image was generated using something similar to this:


Because the server is locked down; the CFIDE directory is not located in the root directory of the server. Even if it were, GraphData.cfm does not refer to an actual file, but rather a server mapping.

The first thing I verified was that the graph data was actually being created. I thought that perhaps CF did not have write access to the directory it used to generate the chart files. Look here:


If you see files being generated in that directory, then access it not the problem. It was not for me.

Why was I getting broken image links when trying to load a page with dead graphs?

There are a people with this problem on the web, but most of the fixes did not work for me. Manually created a CFIDE folder and a GraphData.cfm folder did not work for me.

Manually creating an ide.cfm file in the CFIDE/main directory did not work for me.

So, what did work?

It turns out at the IIS level I had blocked a lot of URLs related to CFIDE directory. So, to fix my solution I had to remove these blocks.

Follow these steps:

  1. Open up your IIS Control Panel
  2. Click on Request Filtering
  3. Click on URL. If you have setup IIS to block the CFIDE folders, you'll probably see something like this:

  4. Right click on CFIDE/GraphData and click remove

My graphs immediately started showing up. Like magic!

Sign up for DotComIt's Monthly Technical Newsletter

Setting up my Dev Environment with ColdFusion 10, ColdFusion 11, and Apache Web Server

One of the first articles I wrote for the ColdFusion Developer's Journal was about setting up IIS to run on ColdFusion 5, ColdFusion MX, and BlueDragon. This was an article I co-wrote with my friend Charlie Arehart and it was published back in 2003. My intent was to write code once, and be able to test it on different application servers. This worked pretty well.

Nowdays I primarily use Apache Web Server for development purposes instead of IIS. ColdFusion has increased multiple version numbers. The need from the original article still exists. I currently do work on sites that use both ColdFusion 10 and ColdFusion 11. It'd be nice to be able to run both versions of ColdFusion side by side.

This article details how I set up my machine.

Installing ColdFusion

I already have CF10 installed on my machine, but need CF11. My first step was to download the ColdFusion 11 Developer Edition from the Adobe web site and follow the normal install instructions. You could install the EAR/WAR version of CF11 and deploy that using the CF10 instance manager. This is like running CF11 inside CF10. However, I decided to install CF11 in the server configuration mode; similar to how CF10 was previously installed.

During the install, you are given the option to configure your web server. Create a copy of your Apache Web Server conf directory and have the CF11 installer configure that copy. Then you can compare the two configurations to see what has changed. I was hoping that I would be able to make use of virtual servers, attach CF10 to some virtual servers, and CF11 to others. Unfortunately that is not possible.

The Problem

ColdFusion 10 and 11 both use Tomcat under the hood; a change since they have been using JRUN since CFMX when I wrote my initial article. In Apache, the JkShmFile directive is used to associate Apache with Tomcat servlet container. Unfortunately, only one JkShmFile directive can be in an Apache Web Server config; making it impossible to point different virtual servers in the same Apache instance to different versions of ColdFusion.

My Solution

I decided that I could use the same Apache installation with completely different configurations, one pointed at CF10 and one pointed at CF11. I wouldn't be able to run them at the same time unless I gave them different web server ports, but I would be able to do testing against different versions of ColdFusion. I decided this was suitable for my current needs.

This is how to run Apache from the command line and specify your custom config directory

[Apache Install Directory]\bin\httpd -k start -f "[Config Directory\httpd.conf"

The K parameter is used to start, restart, or stop the Apache Web Server depending of the value of the parameter. The f parameter specifies the location of the config file. The f parameter is key to launching Apache with different configs.

I did some testing with this and determined it was working great. But, I wanted to set it up as a service so it would show up in the control panel on my Windows machine. This command did that:

httpd -k install -n "MyServiceName" -f "[Config Directory\httpd.conf \httpd.conf"

Final Thoughts

Although I didn't take it this far, I could have shared a lot of configuration variables between the two servers through the use of Apache includes. That could be the topic of another article, though.

Sign up for DotComIt's Monthly Technical Newsletter

Manually configuring ColdFusion with IIS7

I sent this email out yesterday as part of the Flextras/DotComIt newsletter. I thought I'd repost it here.

I recently had the opportunity to move some of my hosted sites to Amazon web services. The Flextras site, The Flex Show, and my personal blog, are now all hosted on EC2. It has been a few years since I've had to deal with my own production server maintenance; and I came across a weird issue with IIS7 and ColdFusion 9. I thought I'd describe the issue and explain my solution.

IIS6 Compatibility is turned on

Normally, when you create a new instance of an IIS web server, you'll need to associate ColdFusion with it. ColdFusion provides a tool named the Web Server Configuration Tool that can attach an instance of ColdFusion with an instance of IIS. If you happen to be using ColdFusion 9.02--or later--and IIS7; you may receive this error:

The Web Server Configuration Tool will not work with IIS7 if IIS6 Management Compatibility is enabled. On this particular server, the management compatibility was enabled for the FTP plugin could be managed on the server. I did not want to uninstall the IIS management compatibility if I could avoid it. How could I tell IIS7 that it should send .cfm requests to ColdFusion for processing without using the Web Server Configuration Tool?

Editing the applicationHost.config file

Under the hood the mappings that tell IIS7 how to communicate with ColdFusion are in a file named applicationHost.config. You can find this file in the 'C:\Windows\System32\inetsrv\config\' directory. This file contains a lot of configuration for IIS7.

If IIS7 was already installed when ColdFusion was initially installed, then you can find a section that references an existing IIS7 instance with your existing ColdFusion instance. Look for something like this:

<location path="iisInstanceName">
<clear />
<add name="ISAPI-dll" path="*.dll" verb="*" modules="IsapiModule" resourceType="File" requireAccess="Execute" allowPathInfo="true" />
<add name="CGI-exe" path="*.exe" verb="*" modules="CgiModule" resourceType="File" requireAccess="Execute" allowPathInfo="true" />
<add name="AboMapperCustom-130401" path="*" verb="*" modules="IsapiModule" scriptProcessor="C:\ColdFusion9\runtime\lib\wsconfig\1\jrun_iis6_wildcard.dll" requireAccess="None" responseBufferLimit="0" />
<add name="AboMapperCustom-130411" path="*.jsp" verb="*" modules="IsapiModule" scriptProcessor="C:\ColdFusion9\runtime\lib\wsconfig\jrun_iis6.dll" requireAccess="Script" responseBufferLimit="0" />
<add name="AboMapperCustom-130412" path="*.jws" verb="*" modules="IsapiModule" scriptProcessor="C:\ColdFusion9\runtime\lib\wsconfig\jrun_iis6.dll" requireAccess="Script" responseBufferLimit="0" />
<add name="AboMapperCustom-130413" path="*.cfm" verb="*" modules="IsapiModule" scriptProcessor="C:\ColdFusion9\runtime\lib\wsconfig\jrun_iis6.dll" requireAccess="Script" responseBufferLimit="0" />
<add name="AboMapperCustom-130414" path="*.cfml" verb="*" modules="IsapiModule" scriptProcessor="C:\ColdFusion9\runtime\lib\wsconfig\jrun_iis6.dll" requireAccess="Script" responseBufferLimit="0" />
<add name="AboMapperCustom-130415" path="*.cfc" verb="*" modules="IsapiModule" scriptProcessor="C:\ColdFusion9\runtime\lib\wsconfig\jrun_iis6.dll" requireAccess="Script" responseBufferLimit="0" />
<add name="AboMapperCustom-130416" path="*.cfr" verb="*" modules="IsapiModule" scriptProcessor="C:\ColdFusion9\runtime\lib\wsconfig\jrun_iis6.dll" requireAccess="Script" responseBufferLimit="0" />
<add name="AboMapperCustom-130417" path="*.cfswf" verb="*" modules="IsapiModule" scriptProcessor="C:\ColdFusion9\runtime\lib\wsconfig\jrun_iis6.dll" requireAccess="Script" responseBufferLimit="0" />
<add name="AboMapperCustom-130418" path="*.hbmxml" verb="*" modules="IsapiModule" scriptProcessor="C:\ColdFusion9\runtime\lib\wsconfig\jrun_iis6.dll" requireAccess="Script" responseBufferLimit="0" />
<add name="AboMapperCustom-130419" path="*.hbmxml" verb="*" modules="IsapiModule" scriptProcessor="C:\ColdFusion9\runtime\lib\wsconfig\jrun_iis6.dll" requireAccess="Script" responseBufferLimit="0" />
<add name="TRACEVerbHandler" path="*" verb="TRACE" modules="ProtocolSupportModule" requireAccess="None" />
<add name="OPTIONSVerbHandler" path="*" verb="OPTIONS" modules="ProtocolSupportModule" requireAccess="None" />
<add name="StaticFile" path="*" verb="*" modules="StaticFileModule,DefaultDocumentModule,DirectoryListingModule" resourceType="Either" requireAccess="Read" />

If you're using CF Standard, you can just copy and paste this section; then change the path name on the location to be the name of your new IIS7 server instance. Restart your IIS instance and that should be all you need. Otherwise, you'll have to create the above section manually; by copying and pasting from above and changing your paths to relate to your own CF Install.

Although I didn't have the experience of setting this up using CF Enterprise, I expect the procedure will be similar; you'll just need to point to the jrun_iis6.dll for your specific instance of ColdFusion.

How to Create a System for Caching Data

I wrote this article for the monthly Flextras newsletter, and thought I'd share it here.

I was working with a client recently and we had some performance problems while accessing remote data from within our application. The user interface, built with Flex, was accessing our ColdFusion server, and ColdFusion would relay requests onto another remote system using SOAP web services. The web service data didn't need constant updates, so we decided to create a caching system for the data to improve performance. I thought the concepts behind that would make an interesting topic for this month's newsletter.

What Type of Data to Store?

We decided it was best to create a generic system to cache any type of data. The system should handle any type of data we wanted to throw at it. To accomplish this, I created two classes a CacheManager class and CacheData class. The CacheData class is intended to be a generic object used by the CacheManager. Here is a diagram of the class:

The CacheData class is used by CacheManager to store the cached data. It has three properties: the data to store and two dates. The first date is, dateCached, which keeps track of the date and time that the data was first cached. The second element is dateLastAccessed, which keeps track of the date that the data was last accessed. The data property should be protected, or private, or something similar depending upon your language of choice. The two date properties should be publicly accessible.

The class has two methods: get() and set(). The get method returns the data and should also update the last accessed date value to the current date and time. The set method will update the internal data property, as well reset the two dates. In an attempt to keep this as platform agnostic as possible; this would be pseudo code for the class:

package{ class CacheData{
// this value stores the data
protected var data : *;
// this value stores the date that the data was initially stored
public var dateCached:Date
// this value stores the date that the value was last accessed
public var dateLastAccessed:Date
// this method can be used to retrieve the data
public function get ():*{
dateLastAccessed = getCurrentDate();
return data;
// this method can be used to set the data
public function set(value:*):void{
data = value;
dateCached = getCurrentDate();
dateLastAccessed = getCurrentDate();
} } }

This is a very simple class, not much more than a glorified value object.

The CacheManager Class

The CacheManager class is a bit more complicated. This is your application's window into the cached data.

This is the class diagram for the CacheManager:

The CacheManager has two properties; minutesCached and cachedData. The minutesCached property is an internal value will be used to determine when data should be flushed and deleted. The cachedData is also an internal value, but it is a bit more complicated. I created that as an associative array of associative arrays. In Flex, an associative Array would be a Dictionary; in ColdFusion that would be a Struct. The first key of the associative array is the type of data you want to store. I call this the cacheKey. This may be "products" or "orders" or something similar, depending on the data you want to store. The second associative array's key is the dataKey. Examples of this may be "ProductID1" or "Order13" or anything that can be used to uniquely identify the type of data, such as its database's Primary Key.

The combination of the dataKey and the cacheKey is used to retrieve the data. The use of the two key structure allows a single instance of the CacheManager to be used to cache multiple types of data. There are also two methods as part of the cacheManager: store() and retrieve(). The store method accepts three arguments: the data, the cacheKey, and the dataKey. It will create a new object of CacheData object and call the CacheData.set method to store the data. It is the simpler of the two methods.

The retrieve method is where the magic happens. It first check's to verify that the data exists. Then it checks to make sure that the data is still relevant based on the current date and the date that the data was last accessed. If the data is too old; then it can be deleted. Otherwise it can be returned. This is a pseudo code class:

package{ class CacheManager{
// this value specifies how many minutes the data should be cached
protected var minutesCached : int = 1440;
// this value contains the cached data; using a two key structure. A CacheKey and a DataKey.
protected var cachedData:Dictionary = new Dictionary();
// this method can be used to retrieve the data
public function store (data:*, cacheKey:String,dataKey:String):void{
cachedData[cacheKey] = new Dictionary();
cachedData[cacheKey][dataKey] = new CacheData();
return data;
// this method can be used to set the data
public function retrieve(cacheKey:String,dataKey:String):*{
var cacheObject = cachedData[cacheKey][dataKey]
if(!cacheObject){ return; }
var dateToClearCache :Date = getCurrentDate() - minutesCached
if(cacheObject.dateLastAccessed <= dateToClearCache){
cachedData[cacheKey][dataKey] = null; return;
} Return cacheObject;
} } }

Although it is beyond the scope of this article, you could also create a method to automatically clear old cache data. This is probably more memory efficient than waiting until the data is retrieved to clear it out.

Putting it All Together

Now that we have the code behind our CacheManager, the last step is to put that to use. First, create an instance of it; presumably in some globally accessible variable.

public var cacheManager :CacheManager = new CacheManager();

Let's say you just loaded a bunch of products from some remote source. You'd loop over them and store them in the CacheManager instance:

For each product in productArray (product, 'products',
End For Loop

In this code, we use the cacheKey named products and use a product ID for the dataKey. I once read something that said you when you file something; you want to make sure to file it in the way that you can find it when you need it. The dataKey for your cache should follow the same suit. When you need to retrieve the data, you want it to be filed under some name that you can use to retrieve the data later.

Retrieve the data from the cache when you need it, like this:

var product : Product = cacheManager.retrieve('products',;

Be sure to check that you actually got a product back from the cache before you try to use it:

// do something to retrieve the product data from source
// or make sure your code accommodates for a non-existent product
// process product

Final Thoughts

I hope you found this article interesting. I did my best to make this as conceptual as possible, so you may have to modify the code in order to work in the language of your choice.

I have two other mini-announcements that I added to the recent Flextras Newsletter. First, the code that never became the Flextras Flex Spreadsheet Component has been open sourced by the original author. It is a very impressive piece of technology. Second, if you're in the mood for interesting weird music; I recorded a full album worth of songs for February Album Writing Month. It is a nice little diversion from programming at times.

Flash Remoting won't connect "NetConnection.Call.Failed"

I've been doing some with for the Flextras promotions around 360|Flex. As part of the promotions I am creating a customized version of my Game; strictly for Flextras. It is going to allow people to login and will keep score on our server instead of internally to the app.

Since this is a Flash app; I'm using Flash Remoting to connect to our ColdFusion server. Everything worked fine on my local machine. Everything worked fine on my development server (AKA Staging). However, my production machine was giving errors that looked like this:

faultCode: "Client.Error.MessageSend"
faultDetail: "Channel.Connect.Failed error NetConnection.Call.Failed: HTTP: Failed: url:
faultString: "Send failed"

I've tried a lot of different things including not using http instead of https. I knew that Flash Remoting was working on the production server because I had other Flex apps working without problems. So, what was the problem?

I've been working on this on and off for about five days; so tried a lot of different things. In the end I discovered two things:

  1. Make sure your Flash Remoting URL has a '/' at the end of it. '' was not working. It appeared to add a JSessionID on it; which was causing the server to throw a 404 error; causing the whole call to fail. However, if I changed this to '' that problem went away.
  2. Turn off the Flash Builder Network Monitor. The Flash Builder Network monitor was intercepting the call and causing it to fail. The calls appeared to work fine from a web browser with the Flash Builder Network Monitor enabled, but not from the mobile app.

I think--but am not completely sure--part of my issues related to using HTTPS on the server instead of HTTP. That could be the reason I had issues on the production server, but not my local or staging box.

Migrating Instances from ColdFusion 8 to ColdFusion 9

Unfortunately, I came back from lunch yesterday to find my laptop was dead. I couldn't get it to load. It was a refurb unit that had served me well enough for three years. I was hoping to get another 6 months out of it; but it is what it is.

This put me in the unfortunate position of needing to set up a new development machine **NOW**. Thankfully, I have a new machine here just waiting to be set up for development. It gives me a slight delay before I have to replace the laptop.

The old machine had CF8 installed in the multi-server mode. I had used the CF8 instance manager to deploy multiple CF8 and CF9 instances of ColdFusion for development purposes. Could I take those instances created in CF8 and somehow use them in CF9 without having to recreate them from scratch? Yes, the answer is yes.

I wrote a bit my experiences moving these same CF8 instances from one machine to another in the past. Here is how I did it:

  1. First I installed Apache. It is my preferred web server. Then I stopped Apache, backed up the config files, and replaced the 'clean' config files with my old config files. This will give me all the info that attaches Apache to the CF Instances and what not.
  2. Then I installed ColdFusion 9; the multi-server edition. During hte install I attached it to my 'clean' config of Apache. I had no idea, when I was doing it, if that was a good idea or not but it worked and the 'old' Apache config seemed to connect up to ColdFusion without any issues. So now I have a working CF Administrator with an instance manager.
  3. Then I used winmerge to compared my old CF8 install directory and the new CF9 install directory. I copied over all my server instances--except for the cfusion one that was created by default. The server instances are located in the servers directory of the install.
  4. Finally, I scoured over all the differences in the winmerge report to figure out how CF was deciding what was an instance and what wasn't. There are two files:
    • lib\wsconfig\
    • lib\servers.xml
    I believe these two files contain all the data for how the CF Instance manager finds the instances. I used winmerge to move all my "old" instances into the new files. I restarted the Macromedia JRun and Macromedia ColdFusion instances, reloaded the admin and all my old 'CF8' instances showed up. Just like magic.

Now all I have to do is create the Windows services for these instances--as I talk about in my other post. Since CF10 is not going to use JRun, I'm not sure I'll be so lucky during the next upgrade.

CF101 Archive: October 2007 Every Beginner must Grow Up

Disclaimer: In 2007, sys-con closed down the ColdFusion Developer's Journal, and I wanted to post all the articles I had written to this site. I started, but got distracted on other things. I'm performing a purge of my digital archives and found the articles. At this point they are posted here more for my own archival purposes than because anyone is longing to read them.

This article is being reposted in accordance to my contract with sys-con. I had them change the default contract so that I could post articles on my personal site.

This article was my final article. I'm not sure if it was ever published formally, though.

CF101 Archive: September 2007 Object Oriented Pizza

Disclaimer: In 2007, sys-con closed down the ColdFusion Developer's Journal, and I wanted to post all the articles I had written to this site. I started, but got distracted on other things. I'm performing a purge of my digital archives and found the articles. At this point they are posted here more for my own archival purposes than because anyone is longing to read them.

This article is being reposted in accordance to my contract with sys-con. I had them change the default contract so that I could post articles on my personal site.

This is without a doubt the favorite article I've ever written. I wrote it afraid I was going to become the active target for every high level CF Developer. That didn't happen thankfully. I remember the response being relatively positive.

More Entries

All Content Copyright 2005, 2006, 2007, 2008, 2009 Jeffry Houser. May not be reused without permission
BlogCFC was created by Raymond Camden. This blog is running version