Site Contents
My Blog
Wireless & Networking
Hardware & Gadgets
Software Picks
Contact Me

My Articles & Papers
Flex Performance
Server/Client Under the Hood
Multiple Instances of CFMX
Multiple Instance Config
NLB with ColdFusion
Clustering CFMX for J2EE
Multi-Tier Hardware LB w CFMX
Cisco CSS & Coldfusion MX
JRun 4 Jini based Clustering
WiFi Growth

2ID Tacweb

Other Hobbys
Body-For-Life Challenge

Personal Projects
Family Pool
Deck Gate



Welcome to, the personal homepage of Brandon Purcell. I started building many, many years ago to share information I ran across everyday in my role as a Support Engineer and Consultant for Macromedia/Adobe. As a support engineer and consultant I always had a lot to blog about but as I moved into managment roles at Adobe my technical content dwindled.

I currently work as the Director of Technology for Universal Mind. My primary responsiblity is managing the SpatialKey project and it has been an amazing experience. I have been spending a lot of time working with Amazon Ec2 and will share my experiences through the blog in the future. I truly believe that Cloud Computing is the IT platform of the future and we have built the SpatialKey architecture on top of Ec2.

Viewing by Category: ColdFusionMX / Main
August 4, 2009

There is nothing more frustrating than taking 30 minutes filling out some text in a long form only to submit and have your session reset and lose all of your data. Here is a simple solution to keep a session open on forms where users may need an extended period of time for data entry. I included this code on any page where I need the session extended. You can remove the javascript include if JQuery is included on everyone of your pages already.

<!--- Include this file on any page where users may take a 
long time filling in text and you want to keep the session open --->
<cfparam name="variables.refreshrate" default="60000">
<script type="text/javascript" src="/js/jquery-1.3.2.min.js"></script>
<script language="JavaScript" type="text/javascript">
 	function callserver()
var remoteURL = '/emptypage.cfm	';
    $.get(remoteURL,  function(data){

May 14, 2009

In recent months I have been using PHP to extend functionality inside of WordPress for the SpatialKey site and working with JQuery as well. After working with ColdFusion for so long I have gotten spoiled by the CFDUMP tag . Here are a few options similar to CFDUMP for both PHP and Javascript.

CFDUMP for PHP - dBug

CFDUMP for Javascript

September 1, 2008

I will be presenting again at Max this year in San Franscico on the topic of "Architecting ColdFusion For Scalability And High Availability". I want to take a new approach this year and solicit input on specific areas to cover during the presentation. In some cases you come to Max year after year and hear the same thing and since I have only 60 minutes and a lot of content in my head I would like to gather input on what areas the community would find interesting. There are two main areas where I can focus, coding practices for scalability and clustering architectures for high availability. I think for the most part developers attending Max understand best practices for coding (although it doesn't mean they always follow them). The clustering architectures and options have not changed much over the years since CFMX 6 so many of my old articles still apply. I would be interested to hear general thoughts on this topic and areas where I could focus the presentation. My outline is due on the 14th but I think I will probably tweak things all the way through August.

This article highlights the many different Flex development frameworks available as the Flex community has grown by leaps in bounds in recent years.

In my last blog posting I discussed the advantages of using MaxMind GeoIP to obtain a site visitors geographical location based on their IP. In this posting I will show you how to integrate GeoIP into your site using ColdFusion. If you are a ColdFusion developer the most challenging part is getting the java source compiled and into a jar file so that you can leverage the GeoIP Java API in ColdFusion. I have made it easier by taking care of this process

The first thing you will need to do is download the example and jar file. Since this example was written using the Lite version of GeoIP you will need to download the Binary version of the Lite database. After you get it up and running you can download and just replace the .dat file with the full binary version. Go to and look under the section that says "Binary Format", click on the "Download the latest GeoLite City Binary Format" link. After that go ahead and extract the .dat file from the zip.

The zip file that you downloaded above will contain a jar file and two ColdFusion files. Follow along with the steps below and you will be up and running quickly.


  1. Copy geoIP.jar to Jrun4/servers/lib or ColdFusion/runtime/servers/lib (I think that is right for standalone CF it has been a while since I used the standalone version)
  2. Restart ColdFusion or the JRun instance
  3. Create a directory for testing in your webroot and copy index.cfm and application.cfc from the zip file above
  4. Open Application.cfc and modify the entry for REQUEST.GeoIPCityDB to point to the location where you extracted the GeoLiteCity.dat file from above. Make sure you use forward slashes and not backslashes.
  5. You should then be able to invoke index.cfm from the example and start resolving IP's to Geographic locations.

You should be able to take this example code and quickly integrate it into your own site. Overall it is pretty simple, if you are not using an Application.cfc file you will just need to add it to your Application.cfm file. Make sure you add logic so that it only is initialized once. The initial load is a bit expensive but it loads the entire database into memory. It is only about 25MB but it is worth the performance gain you get since you can support hundred-thousands of queries a second. The UDF in the index.cfm file is a little bit bloated but there is some reasoning behind it. When I started using this approach I had already been using IP2Location and had a predefined query structure that I had to adapt to. You can probably simplify the approach for the UDF if you choose to. If there are any other questions feel free to post them or email me.

Early this year I wrote a blog article about using IP2Location to identify a users location and ISP based upon their IP. You can find the previous articles here:

The flaw with this approach is that the data was stored into a database of 4 million rows and it was very expensive to do the lookups even with the performance optimizations of splitting the data up across multiple tables. Recent research has turned up a more optimal approach using GeoIP with a binary based solution that will support several hundred requests per second. Yes that is right, several hundred requests per second. The initial setup and configuration takes a bit of time to get going but it is very simple to update and maintain.

GeoIP is a technology from MaxMind that provides developers with a non-invasive way to determine geographical and other information about their Internet visitors in real-time. When a person visits your website, GeoIP can determine which country, region, city, postal code, area code the visitor is coming from. Furthermore, GeoIP can provide information such as longitude/latitude, connection speed, ISP, company name, domain name, and whether the IP address is an anonymous proxy or satellite provider. In my findings and experimentation I have found that GeoIP is also more accurate than IP2Location.

GeoIP features multiple binary files with different features available based on the price that you pay. A listing of the different versions can be found here. For my practical purposes I used both the City and ISP versions. Another great thing that MaxMind offers is a GeoLite City version that is free that you can use to test integration with your system. All of the API's are exactly the same but it is less accurate than the version you purchase.

The final selling point for me with GeoIP is the different API's that they support. You can integrate it with almost any system using (Java, C, Perl, PHP,, MS Com....and many others). Since I was using ColdFusion I chose to go the Java route. If you are not experienced with Java you may stumble a bit here but I plan on posting the Jar that I built for integration along with sample code to make it very easy to first try the Lite version then use the full version if it works well for you. You can find the Java source here along with the GeoLite version.

If you are experienced with Java and ColdFusion it is pretty straightforward to get up and running. You will just need to compile the java source and build a jar, then place it in the classpath of ColdFusion. It is as easy as instantiating the Java object from CF then making calls to retrieve the information. I recommend encapsulating this into a function and loading the reference to the Java object in an application scope variable that is loaded when the application starts. I did have to work around a few issues in the Java source to get it working properly with CF but there were not too many changes needed.

I have posted a very easy to follow step by step set of instructions on this posting so that you can use to get GeoIP up and running on your site.

I ran into a confusing issue with ColdFusion 8 that could affect users that install the enterprise version with the evaluation option and are using multiple instances.

Here is what led up to this issue occuring for me

  1. Installed ColdFusion 8 as a multi server install with the evaluation option
  2. Created an additional instance of ColdFusion
  3. Entered in a valid serial number into the new instance that I had just created.
  4. After the evaluation period expired the server responded with a blank page for requests although some of the requests completed successfully.
  5. Looking in the error log for the new server I found the following error.

11/12 17:49:21 error IP license restriction is in effect.  Can only accept connection from either localhost or five IP addresses, attempted from  Previous accesses were from [ {192.150.x.x}  {192.168.x.x}  {192.168.x.x}  {192.168.x.x}  {192.168.x.x} ].

Of course I had seen this error many times before but in the CF admin (of the new instance I had created) I saw that CF was running with an enterprise license so it should not have the IP restriction. It occured to me that the main CFusion administrative server did not have the license key. After entering the license key in the CFusion admin and restarting both instances everything cleared up. This will probably rarely happen but it could be really confusing if it occurs so I hope this helps someone.

I ran into a confusing issue with ColdFusion 8 that could affect users that install the enterprise version with the evaluation option and are using multiple instances.

Here is what led up to this issue occuring for me

  1. Installed ColdFusion 8 as a multi server install with the evaluation option
  2. Created an additional instance of ColdFusion
  3. Entered in a valid serial number into the new instance that I had just created.
  4. After the evaluation period expired the server responded with a blank page for requests although some of the requests completed successfully.
  5. Looking in the error log for the new server I found the following error.

11/12 17:49:21 error IP license restriction is in effect.  Can only accept connection from either localhost or five IP addresses, attempted from  Previous accesses were from [ {192.150.x.x}  {192.168.x.x}  {192.168.x.x}  {192.168.x.x}  {192.168.x.x} ].

Of course I had seen this error many times before but in the CF admin (of the new instance I had created) I saw that CF was running with an enterprise license so it should not have the IP restriction. It occured to me that the main CFusion administrative server did not have the license key. After entering the license key in the CFusion admin and restarting both instances everything cleared up. This will probably rarely happen but it could be really confusing if it occurs so I hope this helps someone.

A new version of the MySQL driver has been released that detects ColdFusion when it is running with Coldfusion MX 7 (and 8). This should result in much better performance for CF/MySQL users.

Setting "useDynamicCharsetInfo" to "false" now causes driver to use static lookups for collations as well (makes ResultSetMetadata.isCaseSensitive() much more efficient, which leads to performance increase for ColdFusion, which calls this method for every column on every table it sees, it appears).

The driver automatially detects when it is running in a ColdFusion MX server (tested with version 7), and uses the configuration bundle coldFusion, which sets "useDynamicCharsetInfo" to "false" (see previous entry), and sets useLocalSessionState and autoReconnect to true.

The update for this driver should should help with performance. I have personally not tested this driver but wanted to pass this information along.

This was something that I meant to write about a while ago but never got around to it. I recieved a question recently by email and wanted to provide some tips and tricks when using ISAPI Rewrite in a multi-tiered load balanced environment. I wrote an article with Frank DeRienzo several years ago about using a multi-tiered load balanced enviroment. I followed this up later with a blog entry on my site for Using ISAPI Rewrite with ColdFusion.

If you are using ISAPI Rewrite to proxy requests from your webserver (IIS) to you ColdFusion server or through a load balancer you will run into issues when accessing various CGI variables. When proxying the ColdFusion server sees the web server as the end client and therefore variables like CGI.HTTP_HOST are set to the IP or hostname of the webserver. To get around this I inject custom headers with ISAPI rewrite, parse them in CF and then stored them in the request scope.

First I start by adding the headers to the main httpd.ini Start->All Programs->Helicon->ISAPI_Rewrite->httpd.ini (you may need to change the read only flag in order to save the file)

#Due to the proxy we add these headers to use in cf through
RewriteCond %REMOTE_ADDR (.*)
RewriteHeader CLIENT_REMOTE_ADDR: ^$ $1

RewriteCond %SCRIPT_NAME (.*)
RewriteHeader CLIENT_SCRIPT_NAME: ^$ $1

RewriteCond %SERVER_NAME (.*)
RewriteHeader CLIENT_SERVER_NAME: ^$ $1

RewriteCond %SERVER_PORT (.*)
RewriteHeader CLIENT_SERVER_PORT: ^$ $1

RewriteCond %HTTP_HOST (.*)
RewriteHeader CLIENT_HTTP_HOST: ^$ $1

RewriteCond %SERVER_PROTOCOL (.*)

#stores the original URL before any rewriting in a custom header
RewriteCond URL (.*)
RewriteHeader x_rewrite_url_original: ^$ $1

RewriteCond X-Rewrite-Proxy (.*)
RewriteHeader x_rewrite_proxy: ^$ $1

I then create a page in CF called httpheaders.cfm and include it early on in my CF code within Appplication.cfm or within onRequest of Application.cfc

<!--- this page is added to handle the custom headers we write with 
ISAPI Rewrite due to the issues we see with proxying requests.
<cfset httpheaders=GetHttpRequestData().headers>
<cfset REQUEST.proxyheaders=structNew()>
<cfif isdefined("httpheaders.CLIENT_REMOTE_ADDR")>
    <cfset REQUEST.proxyheaders.REMOTE_ADDR=httpheaders.CLIENT_REMOTE_ADDR>
    <cfset REQUEST.proxyheaders.REMOTE_ADDR=CGI.REMOTE_ADDR>
<!--- I need to find a way to handle SCRIPT_NAME better, with ISAPI 
Rewrite and JRun ones are different --->
<cfif isdefined("httpheaders.CLIENT_SCRIPT_NAME")>
    <!--- <cfset 
REQUEST.proxyheaders.SCRIPT_NAME=httpheaders.CLIENT_SCRIPT_NAME> --->
    <cfset REQUEST.proxyheaders.SCRIPT_NAME=CGI.SCRIPT_NAME>
    <cfset REQUEST.proxyheaders.SCRIPT_NAME=CGI.SCRIPT_NAME>
<cfif isdefined("httpheaders.CLIENT_SERVER_NAME")>
    <cfset REQUEST.proxyheaders.SERVER_NAME=httpheaders.CLIENT_SERVER_NAME>
    <cfset REQUEST.proxyheaders.SERVER_NAME=CGI.SERVER_NAME>
<cfif isdefined("httpheaders.CLIENT_SERVER_PORT")>
    <cfset REQUEST.proxyheaders.SERVER_PORT=httpheaders.CLIENT_SERVER_PORT>
    <cfset REQUEST.proxyheaders.SERVER_PORT=CGI.SERVER_PORT>
<cfif isdefined("httpheaders.CLIENT_SERVER_PROTOCOL")>
<cfif isdefined("httpheaders.CLIENT_HTTP_HOST")>
    <cfset REQUEST.proxyheaders.HTTP_HOST=httpheaders.CLIENT_HTTP_HOST>
    <cfset REQUEST.proxyheaders.HTTP_HOST=CGI.HTTP_HOST>

After including this code you can access the client's IP with "REQUEST.proxyheaders.REMOTE_ADDR".

One other challenge is detecting if a user is using HTTPS if you have front ended your site with a load balancer and use the SSL accelerator of BIG-IP or Cisco CSS. To the app it looks exactlyt he same. I will save that discussion for another blog posting. Let me know if you have any questions.

There should be a similar solution with mod_proxy in apache by adding headers I just have not researched it. If you have the information post your findings and I will add it to the blog.

September 26, 2006

Most developers do not spend a lot of time reviewing logs so a lot of errors occur without ever knowing about them. If every error ends up in your inbox then you are forced to address them. I use a template similar to the one below for every site I have developed.

<!--- Send an email with information about the error --->
A user experienced an error on #ERROR.template#. 
<P>The error information is as follows:<BR>
Diagnostics: #ERROR.Diagnostics#<BR>
Template: #ERROR.template#<BR>
Query String: #ERROR.QueryString#<BR>
Path Info: #CGI.PATH_INFO#<BR>
Date/time: #ERROR.DateTime#<BR>
Browser: #ERROR.Browser#<BR>
Request Method: #cgi.REQUEST_METHOD#
<li><b>Users Location:</b> #error.remoteAddress#
  <li><b>Users Browser:</b> #error.browser#
  <li><b>Page Refered:</b> #error.HTTPReferer#
Form Scope:
<cfdump var="#form#" label="form"><br>
URL Scope:
<cfdump var="#URL#" label="URL"><br>
Session Scope:
<cfdump var="#session#" label="session"><br>
CGI Scope:
<cfdump var="#CGI#" label="CGI"><br>
<cfdump var="#Request#" label="Request"><br>
<cfdump var="#cferror#" label="CFERROR Variables."><br>
<!--- end of error email --->
Place static content in here that you want users to see when there is an error. 
I usually put a saved HTML version of the main website with a notice that an error has occured...etc

May 1, 2006

Although it has been quite a while since JRun 4.0 was released the next release is right around the corner. The JRun team has asked me to post the following message to find developers that are interested in test driving the next release of JRun.

The beta release of next version of JRun appserver,  code named Cheetah, is available. Adobe JRun Team is inviting serious evaluators to give feedback on this beta release. Contact to be included in the Beta program.

We believe Beta of JRun Cheetah is reasonably stable and reliable. And we plan to reward those who prove otherwise. We intend to give away fully functional JRun licenses to the users who report highest quality issues during the Beta.

What More ! We are throwing open a JRun Sample Apps Challenge. We invite the beta users to develop sample applications exploiting the new JRun Cheetah feature sets. The best apps developed by you will be rewarded, and on qualification, will be featured as part JRun releases in samples section.

Write Code, find Bugs ! Help us serve you better.

Vijayan Reddy,
Adobe JRun Team.

March 24, 2006

Steven Erat pointed this link out to me regarding ColdFusion MX and JVM Tuning Links.

Here are a few others:

Free stack trace utility

February 20, 2006

In a previous blog posting I discussed how to obtain a users geographical location based on their IP with IP2Location and ColdFusion. In this article I explain how to import the data, break the data into multiple tables for optimization, then create the UDF to perform the lookup. I have had several requests for the stored procedures used to break up the IP2Location data. I have posted them along with the CF code.

You can find the full article here

February 7, 2006

I recently was encountered with a problem where I needed to find what location a user was logging in from based on their IP. There were several reasons why such a system was needed that I highlight below.

Benefits of building such a system

  1. Targeting fraudulent users that share their accounts
  2. Reducing credit card fraud
  3. Display native language and currency
  4. Redirect web pages based on geographical region
  5. Filter access from countries you do not do business with
  6. Geographical targeting for in house ad serving

I first started looking for third party solutions that could be accessed through a webservice but quickly arrived at IP2Location offers a downloadable CSV database that you can run on your own system. The cost is not significant depending on the amount of data you need. They offer IP-Country-Region-City-Latitude-Longitude-ZIPCode-ISP-Domain Database if you need that level of information.   Anyways&on to the technical part.

The CSV format that is provided is simple to import into any database, I was using MS SQL server and imported the data using DTS. There are over 4 million rows in the table so it does not make sense to query directly against the data that was imported for performance reasons. Instead to make the queries very quick that return location data I split the main table out into 20 tables, this left 200,000 rows in each table and proved to scale much better. Since IP2Location offers regular updates I wanted to be able to handle the update process and splitting of the data with very little work on my part. To do that I created two stored procedures.

1. IP2RangeTable The first stored procedure looks at the main table containing 4 million records and divides it into 20 different ranges. Those ranges are then stored in a range table containing the start, end and table name that will store the data.
2. The second stored procedure uses the IP2RangeTable created previously and bulk inserts the range of data from the main table into the range tables. They were simply called range1 - range20.

Both of the stored procedures were written in such a way that the data could be broken out into X number of tables. It just takes the number of tables as a parameter. In this case I used 20. The further you break it out the better it will perform.

Next, I created a UDF in ColdFusion (could be done in a stored proc as well) that takes an IP as an argument. The IP is converted to an IP Number. IP Numbers are used in the database to store the IP2Location content. An example for conversion follows.

IP Number = 16777216*w + 65536*x + 256*y + z     (1)
IP Address = w.x.y.z

For example, if IP address is "", then its IP Number "3401190660" is based on the formula (1).

IP Address =

So, w = 202, x = 186, y = 13 and z = 4

IP Number = 16777216*202 + 65536*186 + 256*13 + 4
          = 3388997632 + 12189696 + 3328 + 4
          = 3401190660 looks at the IP2Range

Once we have the IP number we need to find what table the record is stored in within the range1-rangeX tables. A query retrieves the values stored in IPRangeTable, from that data we can find the correct range table. Next a query is used against the range table to retrieve the location data.

This may sound complicated but it is really simple. Unlimately you could just query the original table that you imported from the CSV but I found the queries to take way to long and caused a lot of stress on the db server under load. Even with the right indexes in place. By breaking the data out into range tables you increase the scalablity exponentially.

Let me know if you have any other questions about this process and the benefits that the data provides.

Later I will explain how the event gateway was used to log this information for every user that logged into the site as a background process.

November 25, 2005
I have ran into this several times before but I always forget the exact code so I figure I would blog it so I had a reference to it.  There are several ways to prevent pages from being cached, I have found that a combination of approaches works best.   This will make sure that it will work across all browsers

Set a meta tag for content expiration

<meta http-equiv="expires" content="Mon, 06 Jan 1990 00:00:01 GMT"> 

You can also use CFHEADER to send a header to the browser forcing it not to cache the data

<cfheader name="expires" value="#now()#"> 
<cfheader name="pragma" value="no-cache">
<cfheader name="cache-control" value="no-cache, no-store, must-revalidate">

see also:

November 3, 2005

ISAPI Rewrite is an IIS ISAPI filter that I have recommended in the past in place of the JRun connector to cluster with a hardware load balancer in between the application server and web server. I outlined the usage in the following article. ISAPI Rewrite can also be used in conjunction with the JRun connector for several different useful features.

In order to use ISAPI Rewrite in conjunction with the connector it will need to be loaded as an ISAPI filter with a higher priority than the JRun connector. The ISAPI Rewrite filter examines requests before the JRun connector processes them so we can perform pre processing (rewriting, proxying, or blocking requests) among other things. I will provide a quick overview of the structure of the configuration files for ISAPI rewrite as well. After you install ISAPI Rewrite it installs the ISAPI Rewrite filter into IIS at the master level so that it affects all sites on that server. All configurations that you want to affect all sites will go into c:\Program Files\Helicon\ISAPI Rewrite\httpd.ini. ISAPI Rewrite also allows you to configure individual settings for each virtual site on the server. By placing a httpd.ini file in the webroot of a site the filter will process it as well, the master file will be processed first then the configuration in the virtual site.

Back to the many uses of ISAPI Rewrite, at least ones that I have discovered you may have more to contribute. If you have questions on the regular expressions I am using take a look at the ISAPI Rewrite documentation.

Blocking URL's

I have used this approach to secure web based administration tools including the ColdFusion administrator. If you wanted to prevent external access to the ColdFusion Administrator and allow access behind your firewall on a private IP you could do the following. Enable the JRun Webserver (default instance runs on port 8500) and access the administrator through http://internalIP:8500/CFIDE/administrator/index.cfm. With IIS configured to the JRun server you would still have external access to the administrator. This is where ISAPI Rewrite comes in. Within the httpd.ini file we can add the following rule that blocks external access to /CFIDE/administrator/

#Block ColdFusion Administrator
RewriteRule /CFIDE/administrator.* [F,I,O]

We could also block RDS using this same approach

#Block ColdFusion RDS
RewriteRule /CFIDE/main/ide.cfm.* [F,I,O]

You can use this approach to block any URL all that is needed is a simple regular expression.

Rewriting SES (Search Engine Safe) URL's

The following rule will convert search engine safe (SES) URL to a standard URL so you don't have to handle them in your ColdFusion code.

#Convert SES URLs to standard URLs before passing them to ColdFusion
RewriteRule (.*?\.cfm)(\?[^/]*)?/([^/]*)/([^/]*)(.+?)? $1(?2$2&:\?)$3=$4?5$5: [N,I]
RewriteRule (.*?\.cfc)(\?[^/]*)?/([^/]*)/([^/]*)(.+?)? $1(?2$2&:\?)$3=$4?5$5: [N,I]

For example the following URL gets converted

http://host/page.cfm/var1/value1/var2/value2 -> http://host/page.cfm?var1=value1&var2=value2

Rewriting URL's for SEO optimization

I am not going to go into depth on search engine optimization (SEO) as I could spend a year just writing about it. One of the common things I have found is that a URL with keywords early after the hostname is rated better than including them in the query string at the end. You can create URL's that are easier to read as well and make it look like the pages the user is surfing is static content although it is generated on the fly. The following is not a real world example but I will say that I have used this approach with much success for data drill down applications to get search engines to rate the content highly. I don't want to give away any secrets though :-)

Let say we wanted a search engine to crawl our site for specific keyword that would be common search terms. If this were a dynamic ColdFusion page the URL's would look something like this.


With the following rule in httpd.ini we could rewrite the above URL

RewriteRule /search/(.*)\.htm /search.cfm\?keyword=$1 [I,O]

The following URL's
http://host/search/keyword1.htm -> http://host/search.cfm?keyword=keyword1
http://host/search/keyword2.htm -> http://host/search.cfm?keyword=keyword2
gets rewritten to the URL's that we examined in the beginning, to ColdFusion it doesn't know the difference. We could provide a page with links to all of the common keywords and let the search engine walk through and index them. It may not seem apparent right away how this is such a cool thing but with a little imagination you can use this approach for a lot of things

Rewriting URL's to hide the file extension

This is similar to the example above except we are just hiding the actual file extension. For example we could rewrite .html requests to .cfm requests.

RewriteRule (.*)/(.*)\.html(.*) /$2.cfm [I]

Proxying Requests to Other Hosts

Lets say you had a single web server and host and multiple backend systems that you wanted to integrate through the same hostname. One system running ColdFusion, another system that is servlet based running on Tomcat. Of course you could integrate them but lets assume that is not an option. With J2EE applications you normally have a context root or prefix to every request. Lets assume that we have a context root of /myapp so all requests look like the following http://host/myapp/page.jsp. Lets also assume that this application is running on a different server other than the one ColdFusion or JRun is running on ( on port 8080). The following rule would proxy requests from IIS to the server running our other application.

RewriteProxy (/.*myapp.*) http\://\:8080$1 [I]

Proxying requests to remove the JRun connector

This is the approach I used in my article for JRun clustering with a hardware load balancer in between the webserver and application server. Since the standard protocol for the JRun connector is JRPP it does not work well through a hardware based load balancer. If you are using a context root in your ColdFusion application of / you will need to proxy by extension and can use the following rules. This will handle nearly every extension that CF needs and passes them to the JWS

#Rewrites to proxy requests back to the appserver level (CF)
RewriteProxy (/.*\.cfm.*) http\://\:8501$1 [I]
RewriteProxy (/.*\.cfc.*) http\://\:8501$1 [I]
RewriteProxy (/.*\.jsp.*) http\://\:8501$1 [I]
RewriteProxy (/.*\.jws.*) http\://\:8501$1 [I]
RewriteProxy (/.*\.jst.*) http\://\:8501$1 [I]
RewriteProxy (/flashservices.*) http\://\:8501$1 [I]
RewriteProxy (/.*servlet.*) http\://\:8501$1 [I]
RewriteProxy (/.*CFIDE/GraphData.*) http\://\:8501$1 [I]

One issue I ran into with this configuration is that a request for http://host will not use the default document in IIS of index.cfm so you can use the following rule to map http://host to http://host/index.cfm

#Fix final slash for /dir
RewriteCond Host: (.*)
RewriteRule ([^.?]+[^.?/]) http\://$1$2/ [R]

#Append index.cfm to any dir
RewriteRule ((?!.+\.cfm).*/) $1index.cfm [I,O]

I would like to mention that I do not recommend removing the JRun connector unless you expect to handle supporting this configuration yourself. This approach is not directly supported by Macromedia but it does work as I have used it in the past. Don't expect Macromedia support to assist you with issues regarding this configuration.

It is worth mentioning that I am a big fan of Apache and you can do all of this with Apache and never have to buy a third party plug in. Apache has mod_rewrite and mod_proxy to accomplish the same tasks.

November 1, 2005

If you haven't taken a look at the Event Gateway feature in ColdFusion 7 the following will provide you a primer on getting started and a valid use case. Ben Forta outlines the process on his blog in a three part series.

Building an IM Bot Part I
Building an IM Bot Part II
Building an IM Bot Part III

For another view on Ben's configuration you can read Peter Reese's experience with setting up GoogleTalk via the ColdFusion XMPP gateway.

I recently used the Asynchronous CFML gateway to replicate data between two servers in a cluster. Look for more on this topic in the future.

August 3, 2005

One challenge I have always ran into with ColdFusion or JRun is that when the server hung on windows there was no easy way to take a thread dump. While jrun.exe is running as a service there is no direct way to send a signal to the JVM to signal a thread dump. Most of the time you have to start it from a console window and let it run there. When you do that though you run the risk of someone closing you user session and having the server die. It is much safer to run it as a service. This takes us back to the problem at hand.....if the server hangs how do I obtain a thread dump? Mike Collins recently pointed me in the direction of a utility that you could use to obtain a thread dump even while running as a service.

The tool is called StackTrace and it is a swing based utility the provides hooks into a java process running as a service. In order to run it you may need to download the latest 1.4 JDK and run the install, it should ask you during the install if you want to install the JRE to Internet Explorer. Check the box and proceed with the install and it will start when you invoke it from the website.

When you open the StackTrace utility you can browse the running java processes and it should look something like this.

If you have multiple servers running it may be difficult to identify which processID is mapped to a particular JRun server there is another utility that I use called Process Explorer from SysInternals. Once you download Process Explorer and open it, select Options > Highlight Services to see what you're running. Right-clicking on a service and selecting Properties gives you all the information you need on the resources it is using. The following screenshot provides an example of the JRun CFusion server. The process ID is 348 and we could choose this process in the StackTrace utility to obtain a thread dump.

One limitation that you need to be aware of is that you cannot use this utility from Terminal Services. This is not a limitation of the product it is a limitation of windows since the utility cannot attach to process running in a terminal window. You must instead use PC Anywhere or VNC to run the utility or run it directly at the console of the server.

I have not used this utility extensively so I do not know how stable it is nor do I directly endorse it. It was something cool that was pointed out to me so proceed at your own risk.

May 31, 2005

As most of you probably already know this year marks the 10th birthday of ColdFusion. I was reading Tim Buntel's blog and he pointed to a page on the Macromedia website where you could post how ColdFusion has changed your life and details on applications you built with CF 1,2,3 or 4. I wanted to take a moment and share my story

It was 1997 and I didn't know what a web app was. As an Army Officer I was tasked with building a system to exchange information for the Second Infantry Division in South Korea. I expored ASP and CGI and found them too cumbersome. I stumbled upon the Allaire site after looking across the net and found ColdFusion. I downloaded CF 3.0 and printed out the hundreds of pages of docs and read them on a long bus ride over the weekend. That next week I started developing a prototype and had something put together in a two weeks that we used in a battle exercise. Sparing the details the application replaced people from building powerpoint slides of information that was hours old. ColdFusion allowed us to build a web based system that was submitted from laptops across the battlefield on a tactical network providing up to the minute information on equipment, personnel and other tactical information. Developement continued over the next six months to build a fairly large although simple to use application

A few years later I implemented Tacweb at the Third Infantry Division in Fort Stewart Georgia and other units across the army started using it. I recieved emails early this year about it and it was used during the Iraqi war.

You can find more information about TACWEB here

If it wasn't for me stumbling across ColdFusion I would have never had the job I have today with Macromedia. I decided it was time to get out of the Army in 2000 and posted my resume on and Allaire called me to support ColdFusion working remotely from my home.  Well the rest is history but I have loved my time so far with Allaire and Macromedia and consider myself very lucky to be able to work with the technology, products and people that I work with on a daily basis.

It is too bad I will miss the birthday party on the 13th of July. I will be on sabbatical starting in June, but it will be nice to enjoy the time off.

April 29, 2005

Over the last few months I have blogged very little due to time constraints, travel and vacation. I have been working on the Flex team for about a year and a half now and still continue to do ColdFusion development anytime a chance arises. I have seen a lot of questions recently about ColdFusion and Flex integration and my goal for blogging over the next few months is answering a lot of the common questions.

  1. Deployment options - seperate instances, single instance (deployed as a singe web app, deployed as a seperate web app)
  2. External Webserver configuration options (IIS & Apache)
  3. Data integration (HTTPService - XML, Webservices, RemoteObject (examples and gotchas)
  4. Authentication and Authorization

I am looking for other questions that I can answer as well and can put together code samples. I might even turn this into a dev center article if I can pull enough content together. Please post your comments or thoughts.

March 24, 2005

JRun 4 Updater 5 was released today. You can find a listing of the issues it addresses here. There are several fixes for the connector that you should check out, especially if you are using connector clustering.

December 10, 2004

I have heard requests from developers using ColdFusion and Flex that they would like more information about integrating the two. One of my coworkers Tom Link started a blog and his first few entries cover ColdFusiona and Flex integration. His first three posts cover the following topics

November 10, 2004
I have had a lot of requests for the CF_Acclerate admin code and I have just been too busy to finish it. Either way I will go ahead and release it as is. Also after talking to a lot of people at MAX I promise to start posting more info on CF and Flex in the  next couple of months :-)

This version of the CF_Accerlate admin was written early on during the development of CF_Accelerate and has not had any features added since. Feel free to modify anything and send me a note with feature additions I will integrate changes in that you feel are useful


Cache Viewer

  • Lists all cached trees and lets you drill down to individual entries
  • Prune a tree at any level or an individual cached entry
  • View the contents of an individual cached entry
  • View the cache date/time, expiration date/time and the content length of a cached entry
  • Add and remove URL's to the cache auto-refresh feature (stored in WDDX file)

Cache Skimmer (Cleans expired Cache)

  • Examines all cached entries and clears out expired cache to manage memory
  • Allows you to (one-click) create a scheduled task that invokes the Skimmer every X minutes
  • Add URL's in the admin to auto-refresh with CFHTTP when the skimmer runs, this keeps the cache fresh

Cache Statistics

  • View total number of Cache entries
  • View detailed number of cache entries for each tree

To install the admin

  1. Extract the zip to your webroot I used /cacheadmin
  2. Modify the Application.cfm file to include your existing Application.cfm file, the admin needs to run in the same scopewhere CF_Accelerate is running to pick up the changes.

The skimmer is a feature that everyone using CF_Accelerate should take advantage of. I have heard complaints of CF_Acclerate hogging memory over time. That is because it does not clean itself out when the cache expires. The skimmer will go through and evaluate all the cached  entries in the tree and clean the cached key using structDelete(). This will allow you to reclaim your memory. It is a pretty simple process  to put this in place

  1. Wherever you installed the admin you will see a subdirectory /cacheadmin/skimmer/ modify the /skimmer/Application.cfm CFINCLUDE so it points to you Application.cfm of the application where you are using CF_Accelerate
  2. You can either add the scheduled task manually pointing to /cacheadmin/skimmer/pruneExpiredCache.cfm or you can use the feature in the CF_Acclerate admin to automatically add it.  If you go to the main page in the admin you will see a link on the left "Skimmer Scheduler". This will bring up a page in the right frame to add the scheduled task that will run by default every 10 minutes. Verify the URL and click the Scheduled Task button.

Thats all that is needed to keep your cache free of stale entries and free up your memory.  I hope this helps you and let me know of anything you think of adding. My time is limited so feel free to provide the code and I will integrate it.

You can dowload the latest version here.

October 14, 2004

Google launched the Beta of its long anticipated Desktop Search tool for Windows today. The application acts as your own personal Google Server and indexes the contents your system by file name, or in the case of select file formats, by the contents of the file. It runs on Windows XP and Windows 2000 (with Service Pack 3).

The free download indexes the full text of email created in Outlook or Outlook Express, Word documents, Excel spreadsheets, PowerPoint presentations, AOL Instant Messages, and caches the pages you view in Internet Explorer so you can revisit the page later "even if its live content has changed or you're offline."

The install is really simple and after you install it starts indexing. If you are working on your system then it will take a while to index. As soon as it realizes the machine is idle it starts churning away. After it indexes the data you are presented with a browser based interface much like the google we all know. Yes is it lightening fast, typing in JRun on my machine turned up 24,107 entries for files and 27,823 for web history, all that in .5 seconds. It looks through basically anything on your machine and indexes it. For free you can't beat this. it is on my short list of the best windows utilities I have ever used.

You can download it here.

August 31, 2004

If you are using J2EE Clustering and session replication with Coldfusion MX 6.1 then Updater 1 offers two important hot fixes that gives you a reason to install it. The following issues are addressed in the Updater

  • 53765 - When Coldfusion MX 6.1 was deployed on clustered Macromedia JRun servers with session replication and J2EE sessions enabled, it would throw a Null pointer exception when the cflock tag was used to lock Session scope.

  • 53913 - In clustered J2EE configurations on JRun if you tried to store a structure in the Session scope and used session replication, the session became corrupted if the request failed over to another server.

The updater can be downloaded at thefollowing location. The issues fixed in the release can befound here

August 23, 2004

Sorry for the inactivity on the blog in the last month but Flex has kept me quite busy lately.

I know that many developers use CFMX on their desktop or laptop for development. Changes in XP SP2 lock down the network functionality of JRun and CFMX. The following technote will walk you through the process of getting CFMX and JRun working properly after installing XP SP2.

Enabling ColdFusion MX with Windows XP SP2

August 10, 2004

I recently updated my article on configuring Installing and Configuring ColdFusion MX 6.1 Multiple Instances with IIS and Apache Virtual Hosts.  There was a problem with the Apache configuration causing errors.  There was an issue highlighted on Steven Erat's blog pointing out that the JRunConfig Apialloc setting must be set in the Virtual Host for second instance, and must be set to false. If not, one in every 4 or 5 requests will return an Apache Internal Server Error to the client with a 500 status code and the Apache error log will record a message such as:

[Thu Jun 24 15:09:33 2004] [notice] jrApache[1635] JRun will not accept request. Check JRun web server configuration and JRun mappings on JRun server.

The article can be found on  There was only one page updated that dealt with the apache configuration.

June 16, 2004

I have heard the question a lot "Should I enable the Save Class Files option in the ColdFusion MX 6.1 Administrator". Well the answer is, it depends!! If you enable save class files ColdFusion will not need to recompile the files across restarts, instead it will load the class file from disk. This can be both good and bad. I willl attempt to explain.

If you have a lot of CFM files or a lot of ColdFusion applications that add up to a lot of Class files you may end up with thousands of class files in cfclasses. The problem is when ColdFusion restarts it searches through the /cfclasses directory to find the class that is needed to load. If it does not find it, then it will compile the .cfm file and save the class file to disk. This adds up to a lot of file IO along with a search through the file listing to find the class file. Both of these procedures add up to a lot of time as the number of files in /cfclasses increases. With thousands of class files this may take 500+ ms to occur or even longer. It only increases as the number of files increases.

Saving class files to disk gained you a lot more with CFMX 6.0 because of the compiler that was used. It used javac or jikes to compile and was really slow. The new 6.1 compiler converts the CFM files directly from CFML to bytecode and if you have a speedy processor it happens in 100-200ms and loads the class into memory. Load tests have shown this to be faster with large numbers of class files in /cfclasses.

So, the choice for this setting depends on the number of cfm templates you have. The only way to find out is to test which option performs best in your situaion.

June 12, 2004

ColdFusion, JRun and Flex TechNotes are now available as RSS feeds at the following URLs:

June 3, 2004

On Tuesday June 8th I will be presenting at the Syracuse ColdFusion User Group Meeting. I will be presenting on Performance Tuning ColdFusion.  As we all know, your ColdFusion applications can never perform as well as you want them to. This presentation will explain how to measure performance, load test and tune your server to squeeze out every last drop of speed.

I will discuss my experience from lessons learned working with countless customers through the Macromedia professional services and support organizations. The tuning process is described in detail along with information specific to tuning ColdFusion application code and server settings. This includes the process of

  • Monitoring Performance
  • Finding bottlenecks
  • Running load tests
  • Systematically finding optimizations
  • Tuning J2EE application server settings

Hope to see you there. You can find the details on the Central New York Usergroup website. I will driving over from Rochester, are there any ColdFusion users in the Rochester area? I am working on lining up other presentations in the upstate New York area.

May 26, 2004

I have recieved several questions asking how do I bind XML data to a datagrid? The following code binds a simple XML string that is retrieved through the HTTPService using ColdFusion. ColdFusion could be replaced in this case with a JSP or Servlet. Be aware, there is a known issue with the Flex webservice proxy when you try to invoke XML through a webservice. The XML will be encoded incorrectly and will not decode in the Flex application. The workaround is to use HTTPService and create a .cfm or .jsp page that serves as a gateway.

   <name>Brandon Purcell</name>
   <title>Principal Engineer</title>
   <name>Bill Phillips</name>
   <title>VP Engineering</title>
<cfheader  name="content-type" value="text/xml">
<cfsetting enablecfoutputonly="yes" showdebugoutput="no"> 
-----end xmlService.cfm-----
<?xml version="1.0" encoding="utf-8"?>
<mx:Application xmlns:mx="" 
<mx:HTTPService id="myHTTPDetail" showBusyCursor="true" method="GET" 
  <mx:DataGridColumn columnName="id" headerText="Id" width="40"/>
  <mx:DataGridColumn columnName="name" headerText="Name" width="115"/>
  <mx:DataGridColumn columnName="title" headerText="Description" width="130"/>
  <mx:DataGridColumn columnName="phone" headerText="Price"/>
------end datagridXML.mxml------

May 11, 2004
Macromedia is celebrating our customer community by hosting Community Week, May 17-21, an opportunity to learn, network and interact with Macromedia product managers and our customer community. There will be free online presentations and a worldwide meeting on Wednesday. Go to for more information. Macromedia Community Week

May 10, 2004

I recently received the question below on Enterprise clustering with ColdFusion MX 6.1 and wanted to share my response.

"I was hoping you could point me in the right direction as far as which options you would recommend. I am setting up an enterprise environment for an application using CFMX J2EE and hardware load balancing. There will be 2 hardware load balancers, 2 webservers running Linux/Apache and 3 app servers running CFMX 6.1. In one of your articles you describe the situation where the hardware load balancers are used to balance the load for the web servers and the connectors are clustered using JRun's connector clustering. In another you describe a situation where there is a load balancer in front of the webservers and a load balancer in front of the app servers. I was hoping you could advise me on which of these are best suited for an enterprise level architecture, I was initially thinking of going for the first option but now I am condsidering the second. Also, from your experience, which HLB would you recommend?"

In the two articles in the links below I outline two different architectures. The first architecture has a hardware load balancer in front of the web servers and uses the JRun web server connector to handle failover and load balancing to the application servers. The second architecture uses a hardware load balancer both in front of the web server and between the web server and application server.

The first architecture is the easiest to setup and scales pretty well. The one pitfall I find is that the JRun connector clustering feature does not offer application awareness. Basically if your application hangs on a ColdFusion server the connector will continue sending requests to it. The most scalable and redundant option is to use multi-tier hardware. It is by far the most difficult to configure but it is worth it if you want to minimize downtime. The multi-tier hardware option gives you true application level failover and load balancing using probes and custom load balancing algorithms. You really only need a single F5 or CSS to accomplish this as well. You can set up a single BigIP to handle all traffic. Basically, traffic flows from the internet into the BigIP then it is sent to the pool of web servers, then proxied back to the BigIP then sent to the pool of ColdFusion servers. This is outlined in the multi-tier hardware article. That is how Frank and I configured our BigIP for the article mentioned below. If you have a second box you can put them in a master/slave setup so if the hardware device fails it will fail over. With a master/slave configuration and multiple web, application and db servers you should 99.9% uptime with your site.

As far as my hardware recomendations, I have primarily worked with only the Cisco CSS and F5 BigIP devices. The CSS is a great box and if you are already familiar with Cisco products it is a great fit. By far though my favorite is the F5 BigIP device. It does almost anything you want and is really easy to use either through the web based admin or command line. It also offers Icontrol which is a really powerful addition worth taking a look at.

Referenced Articles:

  1. Clustering ColdFusion MX 6.1 Enterprise on JRun
  2. Multi-Tier Hardware Load Balancing with ColdFusion MX 6.1

April 22, 2004

Frank DeRienzo and I have had a lot of requests for an article on integrating Microsoft NLB and ColdFusion/JRun clustering. Frank and I set this up in the lab a few months back and sat down to write up the steps. I have to be honest though. I am not a big fan of NLB as a clustering technology because of the lack of application level monitoring.  Then again it is provided free with Windows 2003.  There are less options now that Cluster CATS is being deprecated so NLB is one of the new software based options. Of course if you are looking for the best solution always go with hardware.

After the editing process is complete this article will be featured on the website. You can view the current article here. This process will work for ColdFusion MX 6.1 Enterprise or JRun 4. Feel free to post comments below.....

The latest revision of the article is now live on the website.

April 7, 2004
Macromedia Max 2004 was announced today and it is being held November 1-4 in New Orleans, Louisiana.  You can find more information on

April 5, 2004

A few months ago I ran into an issue where after deploying ColdFusion to WAS 5 we could not get it deployed to a second instance running on the server. The feedback the WAS admin gave and the logs was very unhelpful.  It turns out that if you create a second instance throught he admin console you can only use it for clustering.  If you want to create a second instance that will be used for a seperate deploy you need to follow a different procedure. The procedure is outlined in a technote on the website. Thanks to Sarge and John Z for working this issue out.

BTW, these instructions work the same for any J2EE application you deploy on WAS including Flex.

April 2, 2004

I was writing an application in Flex using ColdFusion as the backend. I first started using Webservices for my implementation and was wondering if I could easily switch it to Flash Remoting without modifying any of my other code. After all with CF, a CFC can be exposed either by web services or by Flash Remoting without any changes on the CF end.

My initial code looked like the following in Flex that called the CFC as a webservice

<mx:WebService id="usersCFC" 
 <mx:operation name="getAllUsers"

Notice I am just pointing the wsdl in the WebService tag directly at CF. Now if I want to use the ColdFusion Flash Remoting gateway instead, I don't have to change any of my other code in my MXML document. I just need to change the data tag. I just comment out the mx:WebService tag and replaced it with the following

<mx:RemoteObject id="usersCFC" 
 <mx:method name="getAllUsers"

Notice that I am not using the AMF implementation that ships with Flex. Instead I am using the CF flash gateway by modifying the endpoint attribute in the mx:RemoteObject tag.

The only issue that I ran into when doing this was with CF's handling of webservices. All variables returned from a CF webservice are uppercase even if they are not in the cfc file. With Flash remoting they are returned exactly as they are written. MXML is case sensitive so you may run into an issue here. Otherwise I found that this worked very well.  Pretty cool!!!

**Late addition to this entry: I recieved an email noting that if you use Remoting with the endpoint attribute you will not use the proxy that is built into Flex. If the Flash Remoting server is on a different domain from the originating domain the Flex SWF was loaded from then a crossdomain.xml file needs to be used. You can find details on the crossdomain.xml file in the Flash livedocs. Basically you will run into a problem if Flex is on one machine and ColdFusion is on another. It is also worth taking a look at this Flash Devnet article for a second explanation of crossdomain.xml.

April 1, 2004

Macromedia just release the updated DataDirect JDBC version 3.3 drivers which resolve a large list of issues from earlier versions of the drivers. The new drivers provided in the TechNote should replace the 3.2 drivers shipped in ColdFusion MX 6.1 or the 3.1+ drivers.

For a full list of the issues and to download the drivers see the technote on the website.

March 26, 2004

I have had a lot of requests to put this presentation on my site for download. This is the presentation that I gave at Max 2003, Japan Max 2004, User Group Manager meeting, and the Boston ColdFusion UserGroup.  The presentation cover the steps to secure your ColdFusion Application either through a webserver or programatically. Whether it's authentication, authorization, access control, or roles, security is an important and complex topic. Implementing runtime security and access control involves understanding all of the above and more. Using databases, LDAP, Web server, and many other approaches you will learn how to leverage the ColdFusion MX security framework to greatly simplify securing your applications. This is a great start for using CFLOGIN with ColdFusion with an overview of the tags and functions; CFLOGIN, CFLOGINUSER, CFLOGOUT, getAuthUser(), and isUserInRole().

The slides for the presentation can be downloaded here

The code for the presentation can be downloaded here

March 25, 2004

The JRun Closed Connection error can cause a lot of frustration but if you understand how to debug and find the issue that is causing it, then you can resolve the problem quickly. The JRun Closed Connection error is caused by an issue that occurs in the JVM that causes the JVM to close the socket that is open from the external webserver connector (IIS, Apache, Iplanet) to JRun. The JVM problem can occur due to several different issues

  1. outOfMemory or the JVM approaches the max heap
  2. Native code in a CFX or COM objects causes an error in the JVM

The memory condition can occur in several different cases

  1. If debugging is left on in production with CF (make sure you have it turned off in production not just masking the IP's)
  2. Large resultsets are returned from the database taking up a significant amount of memory (reduce the size of database results you are returning)

Diagnosing the issue: In order to diagnose this issue there are several areas to start. By turning on metrics and JVM Verbose GC output you can monitor the memory and find out if memory utilization is the problem. In some cases the memory spikes very quickly and comes back down. A large recordset returned from a query can cause this behavior. The recordset will populate into memory and GC will clean it up quickly. If the size of the recordset pushes the heap beyond the max heap you will see a problem. Although you may not see an outOfMemory error everytime. Any connections that were in use during this spike will get a JRun connection closed error. If you look in the webserver connector logs you may find connection reset by peer errors as well.

Also review all of your logs for long running pages and errors in the Application.log. If you have a number of errors correct each issue also identify and fix any long running pages.

You can also provide a better user experience by modifying the page that displays when the error occurs. Without modifying the connector errorurl the user will get a white HTML page that says "JRun Connection Closed". You can replace this with an HTML page that just asks them to refresh or place javascript in the page that will refresh automatically. In either the httpd.conf or jrun.ini file modify the errorurl to point to an html page on the webroot of the web server.

For example with IIS you need to uncomment the #errorurl parameter and set it to the html page

While I have not covered every possible issue that can cause JRun Connection Closed errors I have at least provided some quick debugging steps. I will continue to update this entry as I find more approaches for debugging this problem.

March 15, 2004

March 11, 2004

JRun updater 3 was released today. There are many bug fixes and updates to JRun in this release, you can see a full list of the updates and bug fixes here. 

Important Update April 22 2004: If you downloaded the JRun U3 updater before April 14th then you should go back and download it again. There have been several fixes to the connector in this latest update. Specifically the fix that breaks the connector with CF deployed to /. The latest download can be found here.

March 10, 2004

I will be presenting "Securing ColdFusion Applications" at the Boston CFUG meeting on March 23rd. This presentation covers authentication, authorization, access control, roles, using webserver authentication and ColdFusion security tags. For more information see the Boston CFUG website.

March 3, 2004

There are several articles that I would like to recommend reading that were added in February 2004 to the Macromedia Developer Center.  They do not all deal with ColdFusion but I think you will find them quite interesting either way.

Applying RoboDemo to Your Web Apps
By Jake Sibley
Simply put, RoboDemo is the easiest way to create interactive demonstrations and software simulations in Macromedia Flash format. You use RoboDemo to record a series of actions on your computer screen as a compact Flash movie (SWF); then you can easily publish the movie online or send it in an e-mail.

Employee Updater Sample: Building a Client/Server Application with ColdFusion and Flash
By Ben Forta
Ben Forta guides you thorough a muli-step process of building a web service-powered data grid with the Data Connection Wizard in Flash MX Professional 2004. This is really a great bridge for ColdFusion devlopers that want to understand how to connect Flash to ColdFusion using the new components in Flash MX Professional 2004.

The Building Blocks of a Central Application
By Vera Fleischer
I have been meaning to spend some time learing Central but I just have not had to the time to do it. This article provides a simple approach to building a Central App.

March 2, 2004

Steven Erat has added a few notes beyond what I have in my current clustering articles.  If you get stuck with your configuration or run into error I recommend taking a look at his blog entry.

March 1, 2004

It has been a while since I posted to my blog. I have been in Japan for the last two weeks attending Japan Max and working with our MMKK office providing training for our Japan distributors.  It was a great trip and I worked with some of the nicest people I have ever met.  The conference was a great success and well attended. I presented on Securing ColdFusion Applications and manned the support desk answering questions. I also had the pleasure of attending a JCFUG meeting. John Dowdell, Ben Forta and myself handled questions from the group and a lot of positve comments were brought forth.  You can view all of the pictures from the event here.

I will work on posting more items in the future. I have been doing a lot of work on Flex so look for more on that topic.

February 5, 2004

The next major revision to the Java platform and language, version 1.5.0, is now available in beta.
J2SE 1.5 has been developed under the Java Community Process  as Java Specification Request (JSR) 176, which is led by Sun and an expert group of industry-recognized corporate and individual developers.

New features incorporated since the last "major" release - 1.4.0. - include:

  • New language updates: Metadata, Generics, Enumerated types, Autoboxing of primitive types
  • New JVM Monitoring and Mangement API
  • Improved out-of-box performance

There are several additions to the language, you can view a quick overview here. There is improved scalability and performance in this release and improved startup times. One of the changes that will help me most in my day to day job is the new Monitoring and Manageability.  JMX is packaged with this release and the JVM Monitoring & Management API (JSR-174) specifies a comprehensive set of JVM internals that can be monitored from a running JVM. This information is accessed through JMX (JSR-003) MBeans and can also be accessed remotely using the JMX remote interface (JSR-160) and through industry standard SNMP tools.  One of the most useful features is a low memory detector. JMX MBeans can notify registered listeners when the threshold is crossed, see and for details.

The release also contains a more powerful native profiling API called JVMTI. JVMTI is intended to cover the full range of native in-process tools access, which in addition to profiling, includes monitoring, debugging and a potentially a wide variety of other code analysis tools.

We are always having customers generate thread dumps when problems occur. It always needed to be done from the console before and that is akward. This release contains two new APIs, getStackTrace and Thread.getAllStackTraces provide this information programmatically. It is as simple as the following:

StackTraceElement e[]=Thread.currentThread().getStackTrace();
for (int i=0; i <e.length; i++) {

Also in the case of a JVM crash the Hotspot JVM includes a fatal error hander that can run a user-supplied script or program if the JVM aborts. A debug tool can also connect to a hung JVM or core file using the Hotspot JVM serviceability agent connector.

Many of these features more than likelyy will help improve JRun and ColdFusion in the future.

January 30, 2004

I received the following question on the functionality of CF_Accelerate and wanted to share how I worked around it.

"Got a questions regarding the CF_Accelerate customtag you have created. The caching is set according to the querystring and filename right? Well when you have an application that requires users to login, a session will be set whether or not the user is logged in. Now here comes the problem. It doesn't matter whether you are logged in or not, the same pages and its querystrings will be used. So when you log in and the page is cached when you're logged out, the logged in user will still see the page as if the user was logged out. Because the check is being done by sessions.  Do you recognize this problem and do you have a solution to this, or areyou working on something to overcome this? "

This question caused me problems on my own site.  But there is an easy work around. CF_Accelerate without any arguments will exhibit this behavior. The cached is built in a tree based on three attributes:


  1. attributes.scriptName - first key defaults to the cgi.script_name
  2. attributes.primaryKey - second key defaults to the query string
  3. attributes.secondaryKey - third key defaults to the string "default"

The third key is not really used but it is there if you need it.  In your case you could use use a session variable as the secondaryKey to determine if the user is logged in and it will cache different data if they are logged in.  For example

<cf_accelerate secondaryKey="#session.loggedin#">

session.loggedin could be true/false or whatever you want.

On my site when I am logged in I don't cache the data. So I used something like

<cf_accelerate noCache="#session.IsLoggedIn#">

If a user is logged in the data is not cached at all. If a user comes to the site session.IsLoggedIn is false and the data comes from the cache. There may be a better solution, feel free to share your thoughts.


I ran into a case where I needed to change the mapping for CFCHART.  It needs to be changed in two locations.  The first change modifies the HTML that is rendered to the user and the second change modifies the servlet mapping that handles the requests.  

  1. {cfmx-root}/lib/neo-graphing.xml     
    Below changes cfchart engine to generate the image path based on this config.      
    /CFIDE/GraphData.cfm   ==>   /images/GraphData.cfm  
  2. {cfmx-root}/wwwroot/WEB-INF/web.xml   servlet mapping   
    When a request is handled to /images/Graphdata.cfm the GraphServlet will be invoked to find and serve the charts.
    /CFIDE/GraphData.cfm   ==> /images/GraphData.cfm  

January 27, 2004
I found an interesting article in ColdFusion Developers Journal website explaining how to integrate an open sourced Spell Checker into ColdFusion MX.

January 20, 2004

There have been two updates to the Component Invoker and Browsing Utiliy.  The latest update has the following additions/bug fixes

  • Added ability refresh the CFC Listing (Cached for 30 minutes by default) - Thanks to David Sparkman
  • Fixed another malformed URL
  • Added administrator login link
  • Separated out the system components - Updated by Mike Collins

Go to the bottom of the original Invoker Posting for the link to the download.

January 16, 2004

When using session variables within a Macromedia ColdFusion MX 6.1 application, the following error may occur if J2EE session management is enabled in the ColdFusion Administrator:

Error Occurred While Processing Request
Session is invalid
The error is generated when the underlying J2EE session times out before the ColdFusion session times out.  If you have your ColdFusion Applicatoin session timeout set to 40 minutes and a user sets dormant for 35 and hits refresh this error will be thrown. By default, the J2EE session timeout is hard coded to 30 minutes in the cf_root\wwwroot\WEB-INF\web.xml configuration file. A technote has been published on macromedia site with a workaround.

January 15, 2004

My latest article went live on today.  This article explains the process of creating multiple instances with ColdFusion MX 6.1 Enterprise and configuring multiple instances to both Microsoft Internet Information Services (IIS) and Apache using virtual hosts. I outline a step-by-step process installing ColdFusionMX 6.1, creating new instances of JRun, deploying ColdFusion to the new instances, and configuring each new instance to the external web server.

Macromedia has released hot fix to address two issues with cfquery and cfqueryparam in Macromedia ColdFusion MX 6.1.

  • 53852 - When a string expression is evaluated inside a cfquery tag, each single quote character is escaped to two single quotes. In certain cases, such as when complex CFML expressions are evaluated in a cfquery tag especially within a cfloop, the single quotes may be repeatedly escaped.
  • 52305 - Function calls inside a cfqueryparam will result in all single quotes being doubled

You can download the hotfix here.

January 12, 2004

If you install ColdFusion MX 6.1 in the Standalone mode and you want to get realtime statistics on how the server is operating then you can use JRun metrics.  There are several advantages that the metrics offers over cfstat. The one disadvantage is that it does not provide exactly the same data.

Advantages of JRun Metrics over CFSTAT

  1. Logs directly to the JRun logs with timestamps
  2. Format is customizable
  3. Provides JVM memory information

It is pretty simple to enable JRun metrics Open the file /CFusionMX/runtime/servers/default/SERVER-INF/jrun.xml

Uncomment the entry
<service class="jrunx.metrics.MetricsService" name="MetricsService">
<attribute name="bindToJNDI">true</attribute>

Inside of <service class="jrunx.logger.LoggerService" name="LoggerService"> modify
<attribute name="metricsEnabled">true</attribute>
<attribute name="metricsLogFrequency">10</attribute>

Modify the attributes (remove the jrpp. prefix)
<attribute name="metricsFormat">
  Web threads (busy/total): {jrpp.busyTh}/{jrpp.totalTh} Sessions: {sessions} Total Memory={totalMemory} Free={freeMemory}
change to
<attribute name="metricsFormat">
  Web threads (busy/total): {busyTh}/{totalTh} Sessions: {sessions} Total Memory={totalMemory} Free={freeMemory}

By setting the metrics Log Frequentcy to 10 the metrics data will be logged every 10 second with the following format
10/24 12:34:51 metrics Web threads (busy/total) 0/1 Sessions: 0 Total Memory=12032 Free=5880

One note, if you do not have J2EE sessions enabled in ColdFusion Admin then you will not see the sessions in the metrics

If you want to customize the data that metrics provides then you can use the following attributes

AvgQueueTime, AvgReqTime, busyTh, bytesIn, bytesOut, delayMs, delayRq, delayTh, droppedRq, freeMemory, handledMs, handledRq, idleTh, listenTh, sessions, sessionsInMem, totalMemory, totalTh

In the example below I will log not only busy and total threads I will also log; listening, idle, delayed and total handled.

This format works for ColdFusion MX Standalone:
<attribute name="metricsFormat">
  Web threads (busy/total/listen/idle/delay/handled): {busyTh}/{totalTh}/{listenTh}/{idleTh}/{delayRq}/{handledRq} Sessions: {sessions} Total Memory={totalMemory} Free={freeMemory}

This format works for ColdFusion MX J2EE version on JRun:
<attribute name="metricsFormat">
  Web threads (busy/total/listen/idle/delay/handled): {jrpp.busyTh}/{jrpp.totalTh}/{jrpp.listenTh}/{jrpp.idleTh}/{jrpp.delayRq}/{jrpp.handledRq} Sessions: {sessions} Total Memory={totalMemory} Free={freeMemory}

For information about these attributes see the JRun documentation. If you are on CFMX standalone then ignore the jrpp. and web. prefixes. If you are running JRun with CFMX J2EE on top then you will need the jrpp. and .web prefixes. 

January 9, 2004

I ran into a case where someone wanted to remove the /services mapping from ColdFusion MX. You will run into this problem if you have a directory call services in the root directory of your application.  Instead of you /services/file.cfm getting executed the request will be sent to JRun to be handled by the AxisServlet.  This mapping is only used if you are using the webservice engine built into JRun.  To remove the mapping you need to modify the following files




<servlet-mapping id="macromedia_mapping_8">

Restart ColdFusion then restart your webserver and the /services directory will start handling CF pages.

January 7, 2004

I have always found search engines interesting and based on some of the statistics I collect from referring pages I wrote some code that displays the latest referrals from the google search engine. I also like to see where my pages rank and what topics are most viewed on my site. I collect the data by using the cgi.HTTP_REFERER variable and storing it in a db. I parse out the google querystring using a UDF called GetGoogleKeywords from

You can view the realtime google keyword searches on this page.

January 5, 2004

If you are running ColdFusion MX 6.1 and using Oracle or SQL Server then it is highly recommended that you update the macromedia_drivers.jar due to several issues outlined in this technote. If you are not sure what version you have you can use the below code to find out what version of the driver you are using.  The code will output the version number of each DataDirect driver into the System.out log.  (e.g. into C:\CFusionMX\runtime\logs\default-out.log for standalone/Windows).

<cfset drivernames = ", macromedia.jdbc.db2.DB2Driver, macromedia.jdbc.informix.InformixDriver, macromedia.jdbc.sequelink.SequeLinkDriver, macromedia.jdbc.sqlserver.SQLServerDriver, macromedia.jdbc.sybase.SybaseDriver">
<cfset drivernames=Replace(drivernames," ","","ALL")><!--- replace all spaces --->
<cfloop index="drivername" list="#drivernames#">
 <cfobject action="CREATE" class="#drivername#" name="driver" type="JAVA">
 <cfset args= ArrayNew(1)>
 <cfset driver.main(args)>

The CFMX 6.1 version 3.2 drivers report this:
[Macromedia][Oracle JDBC Driver]Driver Version: 3.2.006918003414003124
[Macromedia][DB2 JDBC Driver]Driver Version: 3.2.006918003414005221
[Macromedia][Informix JDBC Driver]Driver Version: 3.2.006918003414001506
[DataDirect][SequeLink JDBC Driver]Driver Version: 5.3.001902
[Macromedia][SQLServer JDBC Driver]Driver Version: 3.2.006918003414004421
[Macromedia][Sybase JDBC Driver]Driver Version: 3.2.006918003414002406

The version 3.1+ drivers from the download (this is what you should be using currently)  report this:
[Macromedia][Oracle JDBC Driver]Driver Version: 3.1.003921002406001721
[Macromedia][DB2 JDBC Driver]Driver Version: 3.1.003921002406002819
[Macromedia][Informix JDBC Driver]Driver Version: 3.1.003921002406001101
[DataDirect][SequeLink JDBC Driver]Driver Version: 5.3.001902
[Macromedia][SQLServer JDBC Driver]Driver Version: 3.1.003921002406002513
[Macromedia][Sybase JDBC Driver]Driver Version: 3.1.003921002406001307

The CFMX 6.0 Updater 3 version 3.1 drivers report this:
[Macromedia][Oracle JDBC Driver]Driver Version: 3.1.003918002406001718
[Macromedia][DB2 JDBC Driver]Driver Version: 3.1.003918002406002819
[Macromedia][Informix JDBC Driver]Driver Version: 3.1.003918002406001101
[DataDirect][SequeLink JDBC Driver]Driver Version: 5.3.001902
[Macromedia][SQLServer JDBC Driver]Driver Version: 3.1.003918002406002511
[Macromedia][Sybase JDBC Driver]Driver Version: 3.1.003918002406001307

Thanks to Tom Donovan for this tip.

2003 was the first year for my blog, the site launched on April 28th 2003 and the first few months traffic was very low. In fact for the month of May I only had 223 page views but by November I had over 55,000 page views. In total I had over 165,000 page views, the graph below shows how traffic grew throughout the year. Google pushed a lot of traffic my way with over 8,600 searches coming from google in 6 months. I also had over 1400 searches from yahoo as well.

Page Views:223Months:Jun 
Page Views:470Months:Jul 
Page Views:1,798Months:Aug 
Page Views:8,210Months:Sep 
Page Views:17,786Months:Oct 
Page Views:28,860Months:Nov 
Page Views:55,641Months:Dec 
Page Views:50,993

Page Hit Statistics for Blog Postings in 2003

  1. 947 hits - Component Invoker and Browsing Utility
  2. 820 hits - Configuring the Microsoft SQL Server 2000 JDBC database driver
  3. 814 hits - How Hyperthreading works in Windows 2000
  4. 682 hits - Performance Tuning and Monitoring Coldfusion or JRun
  5. 593 hits - CF_Accelerate In-memory caching solution
  6. 593 hits - Why ColdFusion is truly platform independent
  7. 521 hits - CF_Accelerate Admin Demo Version
  8. 486 hits - Copying Dual-Layer DVD's onto a Single Layer DVD
  9. 471 hits - What is a Java Thread and How does it work?
  10. 371 hits - Refreshing Web Service Stubs in ColdFusion MX
  11. 343 hits - Configuring the third party MySQL database driver
  12. 316 hits - Changing XML Parsers in JRun or ColdFusionMX
  13. 309 hits - Large Flat Stucts vs Nested Smaller Structs
  14. 306 hits - ColdFusion MX 6.1 Hot fix for data source connection pooling
  15. 275 hits - Generating proxy for WebServicesusing Dreamweaver

There are two other entries worth mentioning since they were posted late in the year. They have been hit pretty heavily since posting them

If there is any content that you would like to see in 2004 please post a comment below.

January 2, 2004

If you have clustered JRun or ColdFusion running on JRun then you may have ran into an issue with sticky sessions. This little technical tidbit may help you out and you will better understand how JRun handles sticky sessions. Many people think that the connector handles sticky sessions with a table of current sessions. Well, it is much simpler than that and here is how it works.

Sticky sessions hinge off of the jsessionid but not the entire id. When you create a JRun cluster the first time the server starts after it is added to a cluster a file called {cfusion}/servers/{servername}/SERVER-INF/ is created and the file contents look something like this:

#Sat Nov 22 07:36:43 EST 2003

The is a 4 character string that is used to pre-pend on the front of every jsessionid that is created by that server. The connector has a listing of all server id's for all servers in a cluster and looks at the jsessionid and determines which server to route the request to. So a jsessionid created by the server with the id c830 will look something like this c830xxxxxxxxxxxxxxxx. By default sticky sessions are set to on even though the JRun documentation states otherwise. You can disable sticky sessions by modifying the jrun.xml with the following XML.

<service class="jrun.servlet.jrpp.JRunProxyService" name="ProxyService">
<attribute name="StickySessions">false</attribute>

You should really leave sticky sessions on unless you are not using the session scope at all. If you are using in-memory session replication you should leave sticky sessions on as well.

If you run into a problem with sticky sessions the first thing to look at is the users jsessionid, make sure it has the first four characters of a valid If it does not all requests with that session id will be round robined across all servers in the JRun cluster.

December 29, 2003

If you are looking for a JDBC driver to use in JRun or CFMX chances are you will find one here on the the Sun site. At the current time there are 197 drivers available in this listing.

December 17, 2003
Based on feedback I recieved from customers running into issues clustering ColdFusion MX 6.1 with the J2EE install I wanted to put together a step-by-step procedure along with screenshots. This article is an update from my Clustering CFMX for J2EE article on the website.  I added all the updates for ColdFusion MX 6.1 and a work around for a 6.1 bug. I will work on putting this on the site so others can benefit. You can view the step by step instructions here. Any feedback is welcome if you think I am missing something.

December 3, 2003

I ran into a case where a developer was having issues with the Oracle driver packaged with CF.  This is a known issue and the workaround is to move back to the U3+ drivers.  After following replacing the macromedia_drivers.jar in JRun4\lib the problem still exhibited itself so the thought was that the drivers did not fix the problem.  My thought was that the problematic drivers were still being loaded from some other location.  There is an easy way to determine this in ColdFusion using the Java API.  Here is the code:

<cfset resource="macromedia/jdbc/oracle/OracleDriver.class">
#resource#: [#resolveResource(resource)#]<br>

<cffunction name="resolveResource" returnType="string">
<cfset var resourceURL = getClass().getClassLoader().getResource(resource)>
<cfif isDefined("resourceURL")>
<cfreturn resourceURL>
<cfreturn "could not resolve resource">

This code will return the location of the Jar file that is loading the class, and it output the following on my machine:

 macromedia/jdbc/oracle/OracleDriver.class: [ jar:file:/C:/JRun4/servers/latestcfbuild/cfusion/WEB-INF/cfusion/lib/macromedia_drivers.jar!/macromedia/jdbc/oracle/OracleDriver.class]

This told me that the drivers were being loaded from another location and they needed to update that Jar instead. 

November 26, 2003

In the past Microsoft rebranded the Data Direct JDBC driver for their own just like Macromedia does with ColdFusion MX. As of sometime in early 2003 they started building their own driver. As of Nov 2003 the SP2 version was available. Data Direct has a comparison data between the Microsoft driver and Data Direct drivers. This would apply to the Macromedia drivers as well since they brand the latest drivers from Data Direct.

Steps for configuring the Microsoft SQL 2000 driver:

  1. Go to the download page or registration page you may need to log in with a Microsoft Passport to gain access to the file.
  2. Scroll to the bottom of the download page and download the setup.exe
  3. Run the setup.exe program. It will install to C:\Program Files\Microsoft SQL Server 2000 Driver for JDBC
  4. Under C:\Program Files\Microsoft SQL Server 2000 Driver for JDBC\lib copy the files msbase.jar, mssqlserver.jar, msutil.jar to the JRun4/servers/lib or CFusionMX/runtime/servers/lib directory. (depending on how you installed CF). In some cases if you installed standalone you will not have a CFusionMX/servers/lib directory, if you do not go ahead and create it.
  5. Restart CF
  6. Open up the ColdFusion Administrator and click on Data Sources
  7. Enter a Datasource name and choose "other" in the dropdown menu for the driver
  8. Enter the following information for the driver details
    JDBC URL: jdbc:microsoft:sqlserver://hostname:port;databasename=dbname
    (my example jdbc:microsoft:sqlserver://;databasename=tacwebdb)
    Driver Class:
    Driver Name:
    Username: dbusername
    Password: dbpassword
  9. Click Submit and the datasource should verify correctly if you have all the parameters correct

Thanks to Sarge for assisting with the steps.

In some cases you may run into an issue with the packaged MySQL driver that comes packaged with ColdFusion. You have the option of configuring a third party driver or the latest driver from the mysql website. The MySQLwebsite contains several different drivers that you can use in different cases. For ColdFusionMX you are best off using the latest production ready JDBC driver (MySQL Connector/J). The driver is available for download at

Steps for configuring the mySQL driver:

  1. Go to the download page and scroll down until you get the Source and Binaries section. Click on Download for either the .zip (windows) or tar.gz (unix).
  2. Extract the file with winzip (windows) or gzip then tar on unix
  3. After extraction you will see the file mysql-connector-java-3.0.9-stable-bin.jar place the file in the the JRun4/servers/lib or CFusionMX/servers/lib directory. (depending on how you installed CF). In some cases if you installed standalone you will not have a CFusionMX/servers/lib directory, if you do not go ahead and create it.
  4. Restart CF
  5. Open up the ColdFusion Administrator and click on Data Sources
  6. Enter a Datasource name and choose "other" in the dropdown menu for the driver
  7. Enter the following information for the driver details
    JDBC URL: jdbc:mysql://servername:port/dbname (I used jdbc:mysql://ps-gamay:3306/scott)
    Driver Class: com.mysql.jdbc.Driver
    Driver Name: com.mysql.jdbc.Driver
    Username: dbusername
    Password: dbpassword
  8. Click Submit and the datasource should verify correctly if you have all the parameters correct

November 24, 2003
Based on feedback I recieved from customers running into issues configuring multiple instances I wanted to put together a step-by-step procedure along with screenshots. We have this information on the website in multiple docs but I wanted to create one doc that outlines all of the steps. I will work on putting this on the site so others can benefit. You can view the instructions here. Any feedback is welcome if you think I am missing something.

November 20, 2003
If you are interested in my examples from MAX for the Securing Applications presentation.  I have examples of using CFLOGIN with virtually every authentication/authorization source you can think of (NT, LDAP, AD, Database, Certs).  I also included details on securing CFC calls, webservice calls and Flash Remoting security.  You can download them here.

For those of you at the conference, Thursday night at 6pm in room 150D I will be presenting along with F5 Labs.  F5 will provide an overview of their products and capabilities. We will be discussing integrating hardware load balancing devices into your infrastructure to ensure maximum scalability, performance and failover with ColdFusion and JRun. I will also provide an overview of how we integrated F5 Big IP into the infrastucture and answer questions around CF/JRun clustering. I will post the presentation sometime later on my site.

November 17, 2003

If you have configured CFHTTP or CFLDAP to communicate securly then you have worked with the command line KeyTool.  If you are new to the command line tool then I suggest a GUI version called KeyTool GUI.

KeyTool GUI is a GUI version of the command-line keytool provided with the Java SDK. KeyTool GUI can be used to create JKS/JCEKS type keystores, generate and store keys and their associated X.509 certificates, generate CSRs, import and store trusted certificates and perform maintenance on keystore entries. A complete list of KeyTool GUI's functionality is included below:

  • Create, load, save and change the password of JKS, JCEKS, PKCS #12, BKS and UBER type KeyStores.
  • Conversion between the aforementioned types.
  • Generate DSA and RSA key pair entires with self-signed Version 1 X.509 certificates.
  • Generate Certificate Signing Requests (CSRs).
  • Import Certificate Authority (CA) replies.
  • Import X.509 certificate files as trusted certificates.
  • Import key pairs from PKCS #12 files.
  • View the details of certificates contained within keystore entries and certificate files.
  • Export KeyStore entries in a variety of formats.
  • Delete or rename KeyStore entries.
  • Clone and change the password of key pair entries.
  • View the details of Certificate Revocation List (CRL) files.

You can download the tool here

I make some references to Garbage Collection Tuning in my Performance Tuning and Monitoring Coldfusion or JRun. Beyond that there are many references available on GC tuning.  One that I find interesting is the "Frequently Asked Questions about Garbage Collection in the HotspotTM JavaTM Virtual Machine" article on the Sun website.  Make sure you fully load test any JVM argument that you try. I have ran into some that have had major side effects, from stability problems to uncontrolled memory growth.

November 12, 2003
One of the major complaints of CFMX's implementation of calling and creating webservices hinges around retrieving and creating SOAP headers. Macromedia just released a technote explaining how to create or process header fields in web services. This TechNote also provides a patch to Apache Axis to allow users to retrieve the response headers from a web service request, as well as a hot fix to allow users to create a SOAP header in a request that has the "mustUnderstand" attribute set to be true.

November 10, 2003

I spent some time putting together an admin for the CF_Accelerate tag. I have not published the code yet but you can look at the admin and give me your thoughts and any ideas for features. Once you have implemented the CF_Accelerate tag in your code you just drop the admin in place and it give you full functionality for viewing, cleaning, and updating your cache.

Cache Viewer

  • Lists all cached trees and lets you drill down to individual entries
  • Prune a tree at any level or an individual cached entry
  • View the contents of an individual cached entry
  • View the cache date/time, expiration date/time and the content length of a cached entry
  • Add and remove URL's to the cache auto-refresh feature (stored in WDDX file)

Cache Skimmer (Cleans expired Cache)

  • Examines all cached entries and clears out expired cache to manage memory
  • Allows you to (one-click) create a scheduled task that invokes the Skimmer every X minutes
  • Add URL's in the admin to auto-refresh with CFHTTP when the skimmer runs, this keeps the cache fresh

Cache Statistics

  • View total number of Cache entries
  • View detailed number of cache entries for each tree

With the online demo version you can view all of the features but some of them have been disable to prevent my sites cache from getting hosed up.

View the online admin here and please post your comments below.

November 6, 2003

While working with another engineer we ran into a strange issue where the sytem clock on a server would jump ahead.  Normally this would not be a problem but the CreateUUID() function is dependent on time in order to not create a duplicate value.  It waits in a while loop for a number of milliseconds and then returns the value.  If the time jumps ahead it will sit in this loop until the we catch up with the clock time.  This could turn pretty ugly if you have alot of code calling createUUID() because the particular method responsible for the UUID is synchronized and  all requests will que up waiting for the method to complete.  The problem turned out to be a JVM bug on windows and the workaround is provided in the following technote

Java Remote Rebugger Interface (JPDA) is another tool you can put in your toolbox when debugging CFMX and JRun. It is pretty simple to setup and get running with JRun/ColdFusionMX.

Described at

Here are the steps:

  1. Create a copy of jvm.config (I called mine debug.jvm.config) and open this new config file for editing
    • remove the switch -XX:+UseParallelGC (this isn't compatible with debugging)
    • add these two debugging switches:
      -Xdebug -Xrunjdwp:transport=dt_shmem,server=y,suspend=n
  2. Run CFMX from the command line
    • With standalone type {cf_root}\runtime\bin\jrun -config debug.jvm.config -start default
    • With JRun type {jrun_root}\bin\jrun debug.jvm.config -start servername
      note that it starts up saying "Listening for transport dt_shmem at address: javadebug"
  3. from a DOS window, with the Sun 1.4.2 jdk in your path,
    jdb -attach javadebug

    Here is an example
    C:\j2sdk1.4.2_02\bin>jdb -attach javadebug
    Set uncaught java.lang.Throwable
    Set deferred uncaught java.lang.Throwable
    Initializing jdb ...

CFMX is still running while you are attached.

Some useful jdb commands:

  • threads - shows all the thread names
  • suspend - stops CFMX ( so you can get a thread dump)
  • where - the all familiar thread dump
  • resume - CFMX resumes execution
  • help - all the myriad jdb commands...

One of the problems I found is that the output dumps out to the console and it is hard to read. I found that it is much easier to direct the output to a file using the following approach

C:\j2sdk1.4.2_02\bin>jdb -attach javadebug > c:\jdblog.log

You still type your commands in the console but the output gets sent to the log. You can use wintail.exe or tail -f to follow the log.

Thanks to Tom Donovan for this Tip

November 4, 2003

In some cases you may want to use Apache 1.2.x with RedHat 8 or 9 but there is an issue when you try to run the Webserver Configuration Tool (wsconfig). wsconfig fails when configuring Apache 1.3.2x on RedHat 8 & 9. RH 8 & 9 both ship with Apache 2.x and when you run wsconfig.jar with Apache 1.3.x it will fail with a message similar to the following:

java -jar /opt/jrun4/lib/wsconfig.jar -server cfusion -ws Apache -dir /usr/local/apache/conf -map .cfm,.cfc,.cfml -coldfusion -v
Found JRun server cfusion at
11/03 15:27:26 info JRun Proxy Server listening on *:51020
Red Hat Linux release 8.0 (Psyche)
Detected Red Hat Linux release 8 or higher
Using Apache binary /usr/local/apache/bin/httpd
Server version: Apache/1.3.27 (Unix)
Server built:   Oct 30 2003 17:18:27
Server's Module Magic Number: 19990320:13
Server's Module Magic Number: 19990320:13.  Supported major magic numbers on this platform are 20020628 and 20020903.

The workaround for this issue is to use a switch (-DWSConfig.redhat-release=7) when you invoke wsconfig

java -DWSConfig.redhat-release=7 -jar /opt/jrun4/lib/wsconfig.jar -server cfusion -ws Apache -dir /usr/local/apache/conf -map .cfm,.cfc,.cfml -coldfusion -v

This will default to using the Apache 1.2.x connector. In some cases if you compiled SSL into Apache you may need to recompile the connector as well.

Here is the complete procedure along with compiling the connector

  1. Install against "default webserver" included with 6.1 and not apache.
  2. cd /opt/jrun4/connectors/src; unzip
  3. Create using the following commands
      (from the doc: )
      APACHE_BIN=/usr/local/apache/bin; export APACHE_BIN        

    ${APACHE_BIN}/apxs  -c  -Wc,-w -DJRUN_SSL   mod_jrun.c  \
              jrun_maptable_impl.c  jrun_property.c  jrun_session.c \
              platform.c  jrun_mutex.c  jrun_proxy.c  jrun_ssl.c        

  4. Start Jrun with Coldfusion:
      cd /opt/jrun4/bin
      ./jrun -start -nohup cfusion
  5. Tell Java to use apache instead of default server:
      (from the doc: )
      java -DWSConfig.redhat-release=7 -jar /opt/jrun4/lib/wsconfig.jar -server cfusion -ws Apache -dir /usr/local/apache/conf -map .cfm,.cfc,.cfml -bin /usr/local/apache/bin/httpd -script /usr/local/apache/bin/apachectl -coldfusion -v
  6. Copy  EAPI enabled so     cp /opt/jrun4/connectors/src/ /opt/jrun4/lib/wsconfig/1/
  7. restart apache

October 31, 2003

Many times I visit customers for performance tuning engagements and I have a process that I go before I start load testing. This process allows me to really see what is happening inside the server. After running a few tests and monitoring this data I can make adjustments to JRun, CFMX, and the JVM. Unless you know what is going on you are really guessing with performance turning. These steps should get you started in the right direction. I plan on working on several other articles geared around load testing, performance tuning, and JVM optimization. Feel free to leave a comment if you have any suggestions for things you would like to learn more about.

You should also review the following presentation.

Use the following steps to configure CFMX 6.1 with the JRun install. It is a bit different with the standalone install.

  1. Enable JRun Metrics in /jrun4/servers/{servername}/SERVER-INF/jrun.xml
    Uncomment the entry
    <service class="jrunx.metrics.MetricsService" name="MetricsService">
    <attribute name="bindToJNDI">true</attribute>

    Inside of <service class="jrunx.logger.LoggerService" name="LoggerService"> modify
    <attribute name="metricsEnabled">true</attribute>
    <attribute name="metricsLogFrequency">5</attribute>

    By setting the metrics Log Frequentcy to 5 the metrics data will be logged every 5 second with the following format
    10/24 12:34:51 metrics Web threads (busy/total) 0/1 Sessions: 0 Total Memory=12032 Free=5880
  2. Configure Logging to log to separate files by modifying the entry
    <attribute name="filename">{jrun.rootdir}/logs/{}-event.log</attribute>
    in jrun.xml. Change it to the following
    <attribute name="filename">{jrun.rootdir}/logs/{}- {log.level}. log</attribute>
  3. On Unix create a custom start script so JVM out stream gets logged to a file
    Script name: start-cfusion
    /web/jrun4/bin/jrun -nohup -start cfusion 1>/web/jrun4/logs/cfusion-out.log 2>/web/jrun4/logs/cfusion-err.log

    This script will log all console output to logs and allow you to capture thread dumps and other data from the logging stream.

    On Windows you need you can follow the following technote
  4. Enable GC details (only available in JVM 1.4.x/CFMX 6.1 ships with 1.4.2 and this works) 
    -XX:+PrintGCDetails -XX:+PrintGCTimeStamps -XX:+PrintHeapAtGC

    For more details see Tuning Garbage Collection

Areas to monitor under load

  1. JRun Metrics - /jrun4/logs/servername-metrics.log
    Monitor the total and in-use threads, also used for monitoring free memory in the JVM
  2. GC Logs - /jrun4/logs/servername-out.log

    After enabling the verbose garbage collection options you can monitor GC times and heap memory allocation. This is the kind of data you will use to tune the JVM arguments.

Example Verbose Output: See Tuning Garbage Collection for details

PSYoungGen total 3584K, used 3583K [0x027f0000, 0x02bf0000, 0x060d0000)
eden space 3072K, 99% used [0x27f0000,0x2aeffe8,0x2af0000)
from space 512K, 100% used [0x2b70000,0x2bf0000,0x2bf0000)
to space 512K, 0% used [0x2af0000,0x2af0000,0x2b70000)
PSOldGen total 1408K, used 1287K [0x060d0000, 0x06230000, 0x227f0000)
object space 1408K, 91% used [0x60d0000,0x6211d10,0x6230000)
PSPermGen total 6528K, used 6489K [0x227f0000, 0x22e50000, 0x2a7f0000)
object space 6528K, 99% used [0x227f0000,0x22e46470,0x22e50000)
6.47463: [GC 4871K->2199K(5376K), 0.0118130 secs]
Heap after GC invocations=7:

  1. Server CPU
    Top or grstat on Unix
    Task Manager on Windows
  2. ColdFusion Logs (Application, Exception) located in /jrun4/servers/{servername}/{cfusionhome}/WEB-INF/cfusion/logs

    Look for Application errors or any out of the ordinary messages in the logs


Under load the application server can appear to slow down and even in some cases hang. Using the data above and JVM Thread Dumps we can quickly diagnose and identify the problems. If a server stops responding to requests you will need to take a thread dump. You should also take one in a case where the thread count in metrics does not return to 0 after a load test ends.

The following document can assist in steps for obtaining the thread dump and diagnosing the results

Steps for diagnosing a hung JRun Server:

October 30, 2003
If you limit the total # of connections (under Advanced Settings in the data source)With Macromedia ColdFusion MX 6.1 you could potentially cause your server to hang, , particularly if the server is under load.  This hotfix will address that issue by fixing an issue with the data source connection pooling code.  Get the hotfix here..

This one comes courtesy of David Stanten in Macromedia Product Support - If you have worked on webservices in CF you will run into a problem - when making a change to the signature of a webservice, there is no easy way to 'refresh' the webservice stubs created by CFMX if a developers doesn't have access to the administrator.  I've also found that even if you manage to figure out the name of the directory containing a given webservices' stub files, you can't simply delete it without causing errors.  (It seems some of these files are stored in memory).   Anywho, once again, the service factory comes to the rescue, with a curiously named 'refreshWebService' function:
<cfobject type="JAVA"
<cfset RpcService = factory.XmlRpcService>
<cfset RpcService.refreshWebService("http://wonderboy:8500/MX/components/dude.cfc?wsdl")>
You can either pass the full path to your wsdl - or, if you've registered a name for the webservice through the administrator, pass that name to this refreshWebService function - i.e. <cfset RpcService.refreshWebService("dude")>
After refreshing your stubs, you're good to go ... AND ready to rock!

Ray Camden asked me to provide some info on why I used nested structs instead of one large flat struct in my CF_Accelerate tag. This all came about when I was doing performance testing on an application that was doing a lot of caching. I tested with CF_Supercache and it uses a large flat struct and we noticed performance degradation as the cache grew very large 5,000-10,000 entries. My thought was that if we broke this down into a tree of structures with less entries in each struct we could speed up the performance. Our load tests in comparison proved the theory. I didn't have exact numbers so I tried another test on my own.

Instead of just wrapping getTickCount() around the code and seeing how long it took to complete I used a load test tool to see how it would act underload in a multithreaded environment. I first created a flat structure and ran Microsoft Web Application Stress Tool against a page that called StructKeyExists() then tried isdefined(). Both StructKeyExists() and isdefined() churned out similar numbers (structure example below)


Flat Structure
Struct Entries Pages/sec
10 761
10000 210

The key I found in this test with the 10,000 entry structure that if I called isDefined() on the first entry in the flat structure I got 700+ pages/sec but if I called it on a entry that was further down the numbers dropped. In this test I called it on the 5,000 entry in the structure.

Next I created a nested structure tree. (example below)



I used 10 structures each containing 1000 entries. Basically the same test as above with the data broken out into 10 structures. I load tested a page that was looking for the 500th entry in one of the structures and found that I was able to get 650 pages/sec. This is three times faster than the flat structure above and using this approach in a caching tag makes a big difference.

I also tried one other test with an 11th structure in this nested tree that contained 100 entries. This brought the total number of entries to 10100. I put an isdefined() call in a page that looked for application.struct11.tree50 and found that I was able to get in excess of 750 pages/sec. This proved my theory that you can improve performance by breaking out the structures into smaller trees. At least this approach worked for my caching tag.

One other note I think that is worth mentioning. I found that this theory applies even more on a multi CPU machine.

The custom in-memory caching tag CF_Accelerate uses this approach and you can download it here

October 28, 2003

Caching can improve performance by leaps and bounds. How caching is implemented greatly impacts your overall performance. CFCACHE is a good solution and load test show great performance with it when there are only a few files in the cache. As the cache directory fills up performance dropped off quickly. Instead of a file based approach CF_Accelerate provides an in-memory solution.

CF_Accelerate provides the ultimate solution for managing large contents of data in-memory and provides an (easy to use managment interface)* for managing cached entries from the page down to a single entry. CF_SuperCache, a custom tag from the Macromedia Developers Exchange provides a good solution but runs into the same problems as CFCache as the cache fill up. It stores all cached entries in the same server scoped structure and this proves to be inefficient. CF_Accelerate breaks through this barrier by segmenting the cached structure out into a tree of structures this reduces the amount of records to search through when you have cache from many pages and sections of a site. Instead of storing them all in one structure they are broken so each page, section, etc has its own structure to hold the cache.

It can be as simple as just placing the custom tag around some content or an entire page. This allows the content to be cached based uniquely on the page name and url parameters and it is super fast.

<cf_accelerate> content....
< /cf_accelerate>

In testing on my laptop I created a page with around 14K of data and wrapped it with <cf_accelerate> to cache the content. Next, I created a script to populate the cache in a single node of the cache tree.. In total I added 9000 entries to the tree and ran a load test that invoked the page and retrieved it from cache.. I was able to get 310+ pages/sec (on my laptop!!!! 2GHz P4 512MB Ram) with the in-memory cache. The total memory taken up by CF was 225MB, 9000 cache entries at 14K a piece totals up to around 126MB.. I compared this to CFCache with the same amount of data and I could not even get 7 pg/sec. With memory prices as low as they are it is worth putting your cache in memory. In a production level server it is not uncommon to have 2-4GB of memory, with that amound of memory you are unlimited with your caching abilities.

I have also tested this with customers and yielded the same results. You can dowload CF_Accelerate here.

* I am in the middle of building an interface to manage the cached data

October 27, 2003

There have been questions around the longevity of JRun as a J2EE application server and its future in the Macromedia product line.  JRun serves as the core of  ColdFusion and the Breeze product and continues to evolve on its own.  Recently NEC signed a three year agreement to use JRun as an OEM product with their ActiveGlobe application server product line along with e-learning and StarOffic offerings. You can read more about the deal at the following site...

Between this and the recently renewed J2EE license agreement with Sun any questions around Macromedia's commitment to JRun should be answered.

When you add a new instance of JRun on windows you are forced to start it throught the command line.  You can add the instance as a service so that it starts when the machine starts. To do this go to you C:\JRun4\bin directory and issue the following command and it will give you all of the options

C:\JRun4\bin\jrunsvc -?

Usage: jrunsvc
-install <jrun-server> [service-name [service-display [service-description]]] [-
or -remove service-name
or -start service-name
or -startimeout <seconds> service-name
or -stop service-name
or -stoptimeout <seconds> service-name
or -status service-name
or -console service-name [-<jrun-option>...]

If I had a server named server1 I would issue the following command

c:\JRun4\bin\jrunsvc -install server1 "Macromedia JRun Server1" "Macromedia JRun Server1"


There is a little known trick when configuring multiple instances with ColdFusion and JRun.  You can use different jvm.config files for each instance thereby giving you the flexibility to configure unique classpaths and memory/heap settings.

This technote explains how to do it.

October 17, 2003

Hot fix for cfinsert/cfupdate

With Macromedia ColdFusion MX 6.1, when cfinsert or cfupdate is used with a table with certain column names, some form fields are not correctly mapped to the table column names. This happens intermittently.

Hot fix for cfform controls

Macromedia has created a hot fix to address issues with the cfform controls in Macromedia ColdFusion MX 6.1. The updated JAR file resolves the following issues with the cfform applets:

  • 52093 - Required fields in cfform / cfinput are not processed in the order they are defined within the form.
  • 53319 - When more than one image is specified for cftreeitem, the first specified image is displayed for all levels.
  • 53398 - Using cftree and cftreeitem throws Java ClassCastException error.

October 16, 2003

The component invoker utility has been revamped with a new look and feel along with more functionality.  Mike Collins has been hard at work making minor adjustments to this utility to make it more useful for developers.  Here are a few of the new additions

  • Redesigned page layout.
  • Added Component properties.
  • Added roles to function header.
  • Create component instance to run with some persisted data and add THIS support.
  • Added support for viewing and calling extended functions.
  • Added package access type.
  • Added displayname and hint for component header.

We would like to continue to improve this utility so your comments are welcome.  You can download the update at the bottom of the original blog posting.

October 10, 2003

If you have any questions whether or not you are on a supported version of Macromedia software you can see the following page:

October 3, 2003

Some applications claim to be platform independent, I will explain to you why I think CFMX 6.1 truly is. I will walk through the steps of deploying the java only install of CF onto windows, do some development work. Then jar CFMX and the CFML files up into an ear file and deploy right onto linux (or any other OS you choose). All without running any installer for CF on linux. Truly a write once deploy anywhere scenario. Pretty Cool eh?

The first step that needs to be taken is do download the java (jar based) install of CF. This install does not contain platform dependant files (verity, CFX, COM) but does include the core files of CFMX. When you go to download the AIX install of CFMX. It is not just for AIX it runs on any OS with a J2EE application server, the file extension for the file is .jar.

To run the installer enter the command
java -jar coldfusion-macr-java.jar (this will bring up the GUI)

You can also run this installer in the console by adding the options i console. For a full listing of the options type -? In this example I will run in GUI and let the installer build an ear for me that I will deploy onto JRun. Here are the steps that I followed, while these steps apply to JRun they may be a little different based on the application server you are using.

  1. Run the CFMX 6.1 installer java -jar coldfusion-macr-java.jar
  2. Choose the ear file J2EE installation
  3. Create a new JRun server through the JMC
  4. Delete the default-ear from the server you just created in {jrun-root}/server/{serverroot}/default-ear
  5. Under the JRun servers root {jrun-root}/server/{serverroot}/ create a directory called cfusion-ear
  6. Copy the cfusion.ear from the installed directory to {jrun-root}/server/{serverroot}/cfusion-ear/
  7. Within the directory {jrun-root}/server/{serverroot}/cfusion-ear/ Extract the ear with the following command jar xvf cfusion.ear
  8. Within the directory {jrun-root}/server/{serverroot}/cfusion-ear/ create a cfusion-war directory and move cfusion.war to cfusion-war.
  9. Within the directory {jrun-root}/server/{serverroot}/cfusion-ear/cfusion-war extract the war file with the following command jar xvf cfusion.war
  10. Within the directory {jrun-root}/server/{serverroot}/cfusion-ear/META-INF open the application.xml and change
    <web-uri>cfusion.war</web-uri> to <web-uri>cfusion-war</web-uri>
  11. Delete both cfusion.ear and cfusion.war
  12. Start JRun and CF will deploy, hit the CF admin.  The CFadmin URL will be dependant by the port you setup JRun to run on and the context root you chose during installation.  I have the port 8101 and a context root of / for my install so my url is:
  13. Walk through the Configuration wizard

At this point we are ready to start development.  You also have the option of configuring CF to work with an external webserver.  For this example I will create a few simple CF pages and setup a few datasources in the admin.  The next step is to jar this entire install up and move it over to a Linux box and extract the ear into place. 

Now in order to deploy the ColdFusion ear onto any OS/J2EE server combination of your choosing you will first need to jar it up.

  1. Make sure JRun is shut down
  2. Within the directory {jrun-root}/server/{serverroot}/cfusion-ear/ run the following command to package CF up
    jar cvf cfusion-package.ear *.*

I have JRun installed on RH 8.0 Linux and that is where I will move and deploy this file but the fact is you could deploy this file anywhere you wanted.

  1. On my linux box I have JRun 4 installed and I have created a JRun server to deploy onto
  2. In the JRun server root of the linux box {jrun-root}/server/{serverroot}/ create a cfusion-ear directory
  3. In the directory {jrun-root}/server/{serverroot}/cfusion-ear/ copy the cfusion-package.ear from Windows to the Linux box
  4. Extract the ear file on the linux box in the directory {jrun-root}/server/{serverroot}/cfusion-ear/  with the following command
    jar xvf cfusion-package.ear
  5. Delete cfusion-package.ear
  6. Start the JRun server on the linux box and you are in business

Using this approach you can build one ear file that could be deployed on any developers machine regardless of operating system.  All you need is a J2EE server and JRun for developers is free.  After doing development you can jar up CF and move it to another environment for testing then onto production for deployment.  Let me know what you think about this approach.

October 2, 2003

If you are running CFMX Enterprise 6.1 on windows with sandbox security and using COM objects then you may run into an issue where your COM object calls fail with the following error

 at com.intrinsyc.typeInfo.MacroViewer.<init>(
 at com.intrinsyc.typeInfo.MacroViewer.<init>(
 at com.intrinsyc.typeInfo.InterfaceInfoFactory.getInfoGivenPROGID(

The problem occurs because CF cannot read the license file from C:\CFusionMX\lib\jintegra.jar.  You can workaround this issue by adding the file C:\CFusionMX\lib\jintegra.jar to your sandbox with read permissions. Restart CFMX and you are in business.

Mike Collins added more functionality to the component invoker to make it even more usefull.

  • Methods are categorized lists (Public, Remote, Private)
  • Methods are alphabetized
  • Method header was added for full details on the method

The latest version can be dowloaded at the bottom of this post.

October 1, 2003
Based on feedback I updated the Component Invoker to handle cases where the component method does not return a value.  I also added error handling to catch any errors during the method invocation.  Any other feedback is appreciated.  The updated version can be downloaded here.

Using the wsconfig.exe or wsconfig.jar utility that ships with JRun and CFMX you can configure external webservers to work with either product.  This tool can either work perfect for you or cause you to beat your head against your desk.  If you run into an issue where either the GUI hangs or through the command line the prompt never returns then you may find the information below helpful. 

When wsconfig first runs it does a port scan from 2900-3000 to list any JRun servers that are running.  In some cases it will hang when the port scan occurs.  In the GUI this occurs when you click the add button.  In the command line version it occurs when it searches for the servers and the prompt never returns.  To test if this is the problem try the following command

wsconfig -host localhost -list  (using the executable version)
C:\CFusionMX\runtime\jre\bin\java -jar C:\CFusionMX\runtime\lib\wsconfig.jar -host localhost -list

This command should provide a listing of all running servers if it does not return to the command prompt and hangs then you can follow the procedure below

By narrowing the ports that are scanned by wsconfig you can prevent the hang.  By default CFMX uses port 2901 for the jndi port.  This port can be found in C:\CFusionMX\runtime\servers\default\SERVER-INF\ under the entry java.naming.provider.url=localhost:2901. If you are running multiple instance of JRun then you can look in each servers SERVER-INF\ file for the range of jndi ports to scan.

To reduce the ports that are scanned use the following java arguments
-DWSConfig.PortScanStartPort=startport -DWSConfig.PortScanCount=portrange

If I had multiple instance and the JNDI ports started at 2901 and ended at 2905 then I would use the following command to list the jrun instances.

C:\JRun4\runtime\jre\bin\java -DWSConfig.PortScanStartPort=2901 -DWSConfig.PortScanCount=5 -jar C:\JRun4\lib\wsconfig.jar -host localhost -list

To run the GUI and only scan those ports enter the following command:
C:\JRun4\runtime\jre\bin\java -DWSConfig.PortScanStartPort=2901 -DWSConfig.PortScanCount=5 -jar C:\JRun4\lib\wsconfig.jar
Modify the ports to your range of JNDI ports and the GUI should work without hanging.

Here are a few other articles that can help with wsconfig debugging

September 26, 2003

If you haven't used the the component browser in CF at /CFIDE/componentutils/componentdoc.cfm then I recommend you take a look.  Here is a utility that goes beyond the component browser by letting you invoke methods on the component.  Basically a test utility.  Here is a screenshot

Component Invoker v1.0

It was originally written by Mike Collins and I added a few things.  We plan on adding more functionality in the future.  If you have any comments post them in the comments section below. Click Here to download this utility.

One of the install options of ColdFusion 6.1 allows you to install JRun then automatically deploy CF on top of it.  This gives you the flexibility of multiple instances, clustering, session replication and other features.  The problem is when you do this, session replication fails and you get the following error message:

[1]java.lang.NoClassDefFoundError: Lcoldfusion/runtime/J2eeSessionScopeStub;
        at java.lang.Class.getDeclaredFields0(Native Method)
        at java.lang.Class.privateGetDeclaredFields(
        at java.lang.Class.getDeclaredField(

When CFMX 6.1 installs it makes some changes to the jvm.config files classpath that break session replication. To get it working remove the following entries that are highlighted in red

# JVM classpath

After making these changes session replication should work fine.

September 25, 2003
Rob Brooks-Bilson posted an excerpt from his book Programming ColdFusion, 2nd Edition on O'Reilly's Web DevCenter called "Top Ten Tips for Developing ColdFusion Components". It is a good start on best practices for CFC's. Check it out here.....

September 10, 2003

Baby boy Purcell arrived yesterday morning at 6:33am healthy and happy.  He weighed in at 6lbs 11oz and 19inches.  It will probably be a while before I get back to blogging :-)

September 3, 2003

If you want to switch the XML parser that JRun or CFMX uses it is pretty simple.  Crimson is the default parser that is used and it is packaged with JRun. To use the Xerces parser rather than the Crimson parser follow the following procedure (thanks to Tom Donovan):

  1. Get the Xerces kit at
  2. extract xerces.jar and place it in the classpath ahead of jrun.jar (for example, in runtime/servers/lib)
  3. add these switches to the JVM arguments in CF Administrator (or in jvm.config for JRun). Note that this is one long line, not three lines -

    Dorg.xml.sax.driver=org.apache.xerces.parsers.SAXParser -Djavax.xml.parsers.DocumentBuilderFactory=org.apache.xerces.jaxp.DocumentBuilderFactoryImpl -Djavax.xml.parsers.SAXParserFactory=org.apache.xerces.jaxp.SAXParserFactoryImpl
  4. restart CFMX ( JRun)

September 2, 2003

August 29, 2003

After deploying the J2EE version of ColdFusion MX to JRun you are stuck with a document root located in {jrun}/servers/{servername}/cufion/ What if you want this docroot to be located somewhere else? I will tell you exactly how to do it.  If you are clustering you can have multiple servers share this docroot. Unfortunately, it's not entirely straightforward so follow along.
To do this, we have to edit XML files to make all this happen. For each server instance, edit the jrun-web.xml file in {jrun.home}/servers/<instance>/cfusion/WEB-INF/ (assuming your context root is /cfusion).

First, remove the section in red. {cfmx} should be replaced by the common document root you've chosen for CFMX, {jrun.home} should be replaced by the JRun install directory and <instance> should be replaced by the name of the server instance whose XML file you are editing.

If the section in black isn't present, you can add it although it represents the defaults.
This removes the default document root mapping (in red) and adds two new mappings (in blue):
a document root mapping to the shared document root a WEB-INF mapping to ensure each server instance can find its own private library files  I typically add a third mapping (of /CFIDE/*) to the instance's CFIDE directory - to save having to copy the CF Administrator code from the CFMX for J2EE install out to the common document root.

Yet another use for using the ServiceFactory in ColdfusionMX.  You can easily list the scheduled tasks with the following code.  Contribution by Dave Stanten:

<cfobject type="JAVA" action="Create" name="factory" class="coldfusion.server.ServiceFactory">
<cfset allTasks = factory.CronService.listAll()>  
<cfset numberOtasks = arraylen(allTasks)>
<cfloop index="i" from="1" to="#numberOtasks#">
<cfoutput> #allTasks[i].task#  </cfoutput>
or, see all details with:
<cfdump var="#allTasks#">

When you run into a bug with ColdFusion a good resource is the hotfix support page for CF.  A fix may already be available for you on this page.  There are currently three available hotfixes for CFMX 6.1 (JDBC Drivers, datasource issue, SSL in the CF admin) and several other hotfixes for previous versions of CF.

August 28, 2003
Yahoo! News is now offering several feeds in the RSS format. The feeds are free of charge to use for individuals and non-profit organizations for non-commercial use. Combine this with a RSS reader like FeedDemon and you don't even need to browse the web for news just open up your RSS reader.

August 27, 2003

With the upcoming release of MX 2004 the website has added several articles highlighting the new features of each product.

Macromedia MX 2004: Creating Better Experiences
by Norm Meyrowitz
Norm Meyrowitz tells how the new family of products will help you make a big difference for your users.

What's New in Macromedia Flash MX 2004
by Phillip Kerman
Data binding, forms, video, more: Find out about revolutionary new features for app developers from Phillip Kerman.

What's New in Dreamweaver MX 2004
by Jennifer Taylor
Hear what Dreamweaver Product Manager Jennifer Taylor has to say about the new version.

What's New in Fireworks MX 2004
by Kim Cavanaugh
Hear Kim Cavanaugh's top 10 reasons to love Fireworks MX 2004. 2004 Update
by Al Ramadan
Al Ramadan introduces you to 2004: the experience that is the new site design.

The New An Experience That Simply Works Better
by Les Schmidt
Les Schmidt tells you why and how Macromedia executed the new design of

Behind the New, New
by Tony Lopez and David Hatch
Learn how the new site structure improves user experience, addresses core concerns, and makes good business sense.

New in the Developer Center: 10 Improvements, MX 2004 Content Preview
by Craig Goodman
Find out what's changedand what's comingin the Developer Center.

A great document on how hyperthreading works in W2K - Interesting read.....

August 19, 2003

This article has been around for a while but it is worth revisiting if you are still using ColdFusion Studio. I switch between Dreamweaver and Homesite + while developing CF but I am comfortable with Dreamweaver. It does take some modifcation to get it setup similar to Studio. This article will get you moving in the right direction.

If you are a fan of Homesite then you have to check out this site.  I stumbled upon it while searching on google.While a lot of the content is geared towards ASP development there are several color coding extensions for other languages that are not included in Homesite.  The one that I was particularly interested in was color coding for Actionscript files.  I am a fan of Flash, but not a fan of the built in actionscript editor.  I would rather just include an actionscript file and work on it within Homesite.

August 18, 2003

As you  integrate Java and ColdFusionMX you may find times where you need to design your java classes to gurantee compatibilty with ColdFusion. In order to do this you need to first understand what classes CF is using under the covers.

The first step is to use CFDump to dump the methods available:
<cfset myStruct=structNew()>
<cfdump var="#myStruct.getClass()#">

This dumps out all the available methods and we see that there is a method called getName() using this method we can see what class that a Struct is actually comprised of

<cfdump var="#myStruct.getClass().getName()#">
tells us that a Struct is an object type of

Well a struct must extend some other type of generic java class so we can use another method that we saw in the first CFDump, getSuperclass().getName()
<cfdump var="#myStruct.getClass().getSuperclass().getName()#">
tells us that the struct extends coldfusion.util.FastHashtable

Well that still is not a generic class used in java so we can go a step further
<cfdump var="#myStruct.getClass().getSuperclass().getSuperclass().getName()#">
this tells us that our base class for a struct is  java.util.Hashtable, this will help when you work with data in java to build compatible data that can be passed easily to CF.

This not only works for structs, you can do this for any ColdFusion datatype.

August 15, 2003
Inserts and updates against Macromedia ColdFusion MX 6.1 password-protected data sources fail in some situations if no username and password is specified for the data source within the ColdFusion Administrator. Hot fix #53527 has been released to fix this issue. Instructions and download are on the Macromedia support site.

Steven Erat posted an interesting entry on his blog dealing with debugging ColdFusion MX Installations.  If you run into a problem this should get you moving in the right direction.  Check it out....

August 12, 2003
I stumbled upon and found some code that would allow you to track users sessions.  This API could change in future versions because it accesses the underlying CF API but it is a nice hack.

One are that has been improved upon in CFMX 6.1 (Redsky) is the CFHTTP tag.  The implementation of the tag has been changed from using the URLConnection class to the HTTPClient implementation (not the Apache version). There are several improvements and now developers have full control of the HTTP requests that are sent out.  Here are a few of the improvements.

  • Supports all HTTP 1.1 operations (GET,POST,HEAD,PUT,DELETE,OPTIONS,TRACE)
  • All operations are allowed to have CFHTTPParams
  • Proxy Server support, including ProxyUser & ProxyPassword
  • Supports SSL Proxy Tunneling

CFHTTPParam improvements

  • Type=Header - allows full control of the HTTP headers
  • Type=Body - Allows full control of content
  • Type=XML - Full control of context (Hardwired Content-Type:text/xml
  • Type=File - Explicit control of Mime types

August 11, 2003

ColdFusion MX hanging condition investigation

ColdFusion MX: Implementing NT authentication for ColdFusion templates with IIS Web Server

Mail is not being sent from the ColdFusion Server

Known ColdFusion MX issues

ColdFusion (Developer Edition): Unable to run ColdFusion templates

ColdFusion MX: Recommended configuration of multihomed Microsoft IIS web servers

Troubleshooting DataDirect SequeLink ODBC service startup issues

There has been a lot of talk on the forums and other listservs about the new installation options with CFMX 6.1.  There were three versions before (Prof, Enterprise, J2EE).  There are now two versions (Standard and Enterprise), but now you get a lot more bang for your buck with Enterprise.  The most significant change in Enterprise is that you get a full install of JRun.  Here are the different options that are on the plate:

  1. Install the historical way and install CFMX with embedded JRun (Standard or Enterprise)
  2. Install a full JRun 4 install with one instance of CF pre installed (you have the option to add multiple instances after the install)
  3. Create a Java archive (ear or war) and deploy on your existing J2EE server (Websphere, Weblogic, JRun....etc)

So with Enterprise you get a lot more than you did before. You get a full J2EE application server with the ability to do multiple instance and EJB's.

If you have made the move to ColdFusion 6.1 (aka Redsky) and are using Dreamweaver as your IDE of choice then you need to download the Tag Update for DWMX.  The files can be found on or downloaded directly from

Some developers have resisted the move from CFStudio to Dreamweaver.  Personally I really like Dreamweaver and have adopted it quickly.  Although there is the option to use Homesite + and make it work like the CFStudio of old.  The following steps will get you moving in the right direction:

  1. 5.2 updater for Homesite+
  2. Function help, download and extract then follow the instructions:
  3. The folllowing blog entry will explain the rest of the steps.

August 7, 2003

I ran into an issue where I needed to pull data from a database that had HTML formatting but I wanted to display the text without the HTML.  A simple ColdFusion Regex solved the problem it is as simple as the following:

<cfset newtext = REReplace(htmlformattedtext,"<[^>]*>","","All")>

In many cases when calling a webservice with CFMX you may have a need to set a SOAP header value.  Using the following code you can easily accomplish this (thanks to Tom Jordahl for the tip)


ws = CreateObject("webservice", "http://localhost:8500/tester.cfc?WSDL");

ws.setHeader("", "myHeader", "This is the value");

ret = ws.echo_me("value");


As the ColdFusion Server product has grown since its inception, the ColdFusion Markup Language (CFML) has adapted to meet those changing needs. A technote on the site provides a downloadable file providing the details of those changes to the language, beginning with ColdFusion 4.0.1 and continuing through the currently released version.

On extremely slow or very heavily loaded Windows systems, the main ColdFusion MX Application Server service might not automatically start on system restart using the default service startup timeout values. Instead, the following error will be seen

The ColdFusion MX Application Server service terminated with service-specific error 2.

This behavior can occur on slower systems or systems with a large number of services that need to initialize at the same time, causing the ColdFusion MX Application Server service to timeout. Beginning with ColdFusion MX 6.1, the -starttimeout switch is added to the command line executable, allowing the startup timeout value to be permanently modified. A technote on the site provides a workaround

On extremely slow or very heavily loaded Windows systems, the main ColdFusion MX Application Server service might not automatically start on system restart using the default service startup timeout values. Instead, the following error will be seen

The ColdFusion MX Application Server service terminated with service-specific error 2.

This behavior can occur on slower systems or systems with a large number of services that need to initialize at the same time, causing the ColdFusion MX Application Server service to timeout. Beginning with ColdFusion MX 6.1, the -starttimeout switch is added to the command line executable, allowing the startup timeout value to be permanently modified. A technote on the site provides a workaround

A new option -cfwebroot is now available for wsconfig.jar. For example, to configure a connector for an additional web site and use the CFIDE directory from the web root, use a command such as the following:

C:\CFusionMX\runtime\jre\bin\java -jar wsconfig.jar -ws iis -site mysite1 -coldfusion -cfwebroot -v

A technote on the site explains this in more detail.

Under some circumstances, if Microsoft SQL Server closes a connection unexpectedly while processing a long-running query, the 3.2 JDBC database driver provided in Macromedia ColdFusion MX 6.1 may respond inappropriately, continuing to wait for a DB server response while unnecessarily consuming CPU resources. This issue does not occur with the 3.1 version of the driver shipped with all earlier releases of ColdFusion MX. See the following technote for a workaround...

On Tuesday, August 5, DevNet launched content for the new ColdFusion MX 6.1 release.  Read all about new and improved cfmail features, better performance, and running multiple instances in the articles below.

Making a Good Thing Better: Introducing ColdFusion MX 6.1 NEW
Ben Forta reviews the most important features in ColdFusion MX 6.1.

Performance Under the Hood in ColdFusion MX 6.1 NEW
See how our QA team re-engineered code to create a new faster-running server.

Running Multiple Instances of ColdFusion MX 6.1 NEW
Get built-in load balancing and failover support for your apps in ColdFusion MX 6.1.

Taking Advantage of Mail Enhancements in ColdFusion MX 6.1 NEW
New and revised tags, a better handler, and failover are just a few changes making mail more efficient.

An Overview of Performance Improvements in ColdFusion MX 6.1 NEW
Find out why the new version is faster than previous versions.

RSS Untangled: Exposing a Java API from ColdFusion
Get the best of both worlds.  Wrap a Java API into ColdFusion components with this RSS example from DRK 4.

August 1, 2003
A good discussion is brewing on the CF-Talk list with different CMS's available for CF

Microsoft has recently published a CFMX vs .NET article on their website.  It is worth reading

July 31, 2003

In the J2EE world many times you will run into a problem where you have multiple versions of a package (jar file) in different places and the application server needs one version and you need another.  This is made even more complex with CF in the middle.  I ran into a case where a customer was trying to run Metaserver on CFMX and they ran into a problem with conflicts with Xalan.  JRun4 includes one version (2.1.0), CFMX for J2EE has another (2.3.2) and Metaserver uses yet a third different version (2.4.1).  Most of the time these components are backwards compatible and the workaround is to put the newest version in the beginning of the classpath.   Placing the JRun .jars first will break the MetaClient and of course putting the Metaserver .jars first will break JRun

Here are the steps that were used to workaround this problem using CFMX for JRun.

1) Stop the JRun server that you have deployed CFMX onto.
2) Copy the .jar files from the /metaserver/clientsdk/lib directory into the /jrun4/servers/<your_server>/cfusion/WEB-INF/lib directory. 
3) Open the jrun-web.xml file found in the /jrun4/servers/<your_server>/cfusion/WEB-INF directory.  Add the following line within the <jrun-web-app> element.


4) In the \JRun4\servers\<your_server>\cfusion\WEB-INF\cfusion\lib directory rename the xalan.jar file to something like xalan.old.
5) Start your Jrun server and try running some test code.

That should do it

July 29, 2003

I ran into a problem where a customer could not use Access databases at all from within CFMX, after looking at permissions and several other items and turning on Sequelink debugging I decided to use an ASP page to test the datasource.  Just place this code in a file called dbtest.asp and put it in the webroot.

dim RS1, SQL
SQL = "SELECT * FROM employees"
Set Conn = Server.CreateObject("ADODB.Connection") ("DSN=CFSnippets")
Set RS1 = Server.CreateObject("ADODB.RecordSet") SQL, conn
Do While Not RS1.EOF

<%= RS1("FirstName") %><br>


July 25, 2003

Many exploits on many Web serversmost often Microsoft IIShave been based on URLs that were technically legal but employed buffer overflows or similar techniques. There are tools to prevent such attacks by constraining the types and parameters of requests made to a server. The most famous is Microsoft UrlScan (, an add-on that almost every IIS administrator should be running. UrlScan is also part of the IIS Lockdown Tool. Microsoft recently issued a small improvement to UrlScan 2.5: It no longer needs to be installed as an upgrade over UrlScan 2.0 but employs its own installer.UrlScan blocks requests such as very long URLs, attempts to run EXE files on a server (an old Nimda trick), URLs with binary data in them, and use of multiply-denormalized URLs (links such as http://%f0%80%80%af/, which must be decoded more than once). The program can also log requests.

July 24, 2003

Below are the steps you need for configuring CFMX to Informix 7.3 using the IBM JDBC driver.

1. Download the JDBC driver from IBM
2. Unzip the tar that is downloaded (JDBC.2.21.JC5.tar)
3. Run java -jar setup.jar from the file that is extracted. It will run the installer and load it to your choice of locations.
4. In the location where you installed the informix driver you will find /lib/ifxjdbc.jar that is the file we need to add to the classpath. 
5. Go into the CF Admin and click on the Java and JVM link under Server Settings
6. Add the file ifxjdbc.jar to your classpath and restart CFMX
7. Go into the Data Sources section and choose other from the dropdown box
8. JDBC URL: jdbc:informix-sqli://;user=informix;password=informix;
Driver Class: com.informix.jdbc.IfxDriver
Driver Name: com.informix.jdbc.IfxDriver

regression is the database name and modify the host:port and the INFORMIXSERVER value along with user and password

If you have had problems connecting CFHTTP using HTTPS then the following post may help you out.

UPDATE June 20th 2011: Nearly 8 years later I was struggling with this issue on Railo and a co-worker and I stumbled across my own blog from searches on Google. Funny how it works sometimes.

It ended up being because the server we were connecting to used certificates and the Java didn't like them. To fix it we exported the certificates from IE Certificate manager after installing them from thier website and the entire certificate chain if neccessary (root, and intermediates)...

Export each to c:\cfusion\runtime\jre\lib\security (Assuming CF is installed at this location) using the bianry x.509 format (The default for IE 6). Name them something recognisable (Site1.cer, site2.cer and site3.cer in this case)
Easy part is done.

Now, run a command line (CMD at Start-Run)
type PATH=%PATH%;C:\CFUSIONMX\RUNTIME\JRE\BIN (Assuming CF is installed at this location)
cd cfusionmx\runtime\jre\lib\security
keytool -import -noprompt -alias SITE1 -file site1.cer -keystore .\cacerts -storepass changeit (assuming you haven't changed the default java password yet)
keytool -import -noprompt -alias SITE2 -file site2.cer -keystore .\cacerts -storepass changeit
keytool -import -noprompt -alias SITE3 -file site3.cer -keystore .\cacerts -storepass changeit

Now restart the CF Services or restart the server and it should work.

With RAILO we ended up installing this in three locations after exporting from IE:

Steps to export from IE:

Steps to export from command line: If you do not have access to IE or just want to pull the cert from the command line the following command will let you do that. Look for the output that begins and ends with -----BEGIN CERTIFICATE-----*******-----END CERTIFICATE-----. Copy the contents of the certifate into a file siteX.cer that will be used to import with the commands above.

openssl s_client -connect host:port

July 11, 2003

In some cases you may have CFMX Professional to serve your .cfm and .cfc requests and you may want JRun to serve your .jsp and J2EE application requests. I will outline this procedure below. With this procedure you will not be able to have a context root of / in any of your JRun applications since it will collide with CFMX. Also, you will not be able to put .jsp files in your webroot due to the context root issue. There is another procedure that would allow you to accomplish this but you would loose flash remoting capabilities in coldfusion since we would only use exentsion mappings for coldfusion.

  1. Configure CFMX to IIS as explained in the docs. See the ColdFusion MX docs for details
  2. Verify the configuration by testing .cfm, .cfc and .jsp files in your webroot. .cfm and .cfc files should serve without an issue and .jsp files should throw a license error.
  3. Open up the IIS Microsoft Management Console and verify that the extensions were added properly. Right click on the server name-> Click on the Home Directory Tab -> Click the Configuration button -> Click the App Mappings tab. The tab should look like it does in the screenshot below
  1. Click on the extension mappings for .jsp and .jws and click Remove for each of them
  2. Open the file CFusionMX\runtime\servers\default\SERVER-INF\default-web.xml and look for the following entry
    Comment this entry out by placing the following characters around it <!-- -->
  3. Restart CFMX
  4. When you invoke a .jsp from the webroot now you should get the JSP source served back to you.
  5. At this point we will configure IIS to JRun, you could also configure IIS to any other J2EE server to serve JSP pages
  6. After installing JRun, start the admin server and open up the JMC (JRun Management Console) and create a new JRun server, we will not use the default server since it uses the same JRPP port as CFMX. When I created the new server I set the Web Connector Proxy Port Number (JRPP) to 51011.
  7. Start the newly created server and enable the ProxyService through the JMC. Click on the server in the lefthand frame -> Click Services at the top -> Click Active WebServers -> Click the Start Button under External Webserver Connection. It should look like the following:
  1. Stop the JRun server and removed the default-ear in /jrun4/servers/{servername}/default-ear. This will prevent the context-root of / conflict with CFMX. Remember when any JRun application is deployed you must use a context root other then /
  2. Modify the CFusionMX\runtime\lib\wsconfig\1\ by adding the JRun JRPP IP:port
  3. Restart IIS and start the JRun server

With this configuration I was able to deploy multiple applications in JRun and access them from IIS and access any CFMX page and the flash remoting gateway in CF.

July 10, 2003

Mike Collins pointed a free content management based system written by By Robin Hilliard and Mark Woods.  It is called Speck and it is a Spectra-like tag library for CF 5.0 and upwards that is already used in several production sites.  Check it out on the CF exchange...

July 3, 2003

In the near future Macromedia will be releasing Spectra under a public open-source license. The source will be available as a free download with which you can build and redistribute Spectra applications as allowed by the Macromedia Spectra Software License (based on the Apache Software Foundation license). See for full details.

When ColdFusion MX (also applies to JRun) is used with Microsoft IIS, Windows NT Authentication, and NTFS file permissions - IIS must be configured to check the file permissions before passing the request to ColdFusion MX and all files must be placed in the webroot of IIS. This is outlined in two technotes on the website.  Many admins have found that after Windows restarts pages no longer get authenticated.  I found a forum posting that outlines some additional steps.

Follow the steps in the following article from the website

The following additional steps were found on a forum posting.

Ok, now for the steps to make the W3 Publishing Service dependent on the
ColdFusion MX Application Server service. It's pretty straightforward:

1) Go to "Start" menu --> "Run...". This should open a small window.
2) In the textbox labeled "Open:", type "regedt32" (without the quotes).
This will open the registry editor.
3) Look for the window labeled "HKEY_LOCAL_MACHINE on Local Machine". Click
on it to make it active.
4) Double click the "SYSTEM" directory to expand it.
5) Double click the "CurrentControlSet" directory to expand it.
6) Double click the "Services" directory to expand it.
7) Highlight (select) the directory called "W3SVC". This is the W3
Publishing Service. You should see settings appear in the right pane of the
8) In the right pane look for a line called "DependOnService". Double click
that line. It should bring up a text area. There should already be a line in
the text area that reads "IISADMIN". Leave that alone. Go to a new line in
the text area and type "ColdFusion MX Application Server" (without the
quotes). You must type this exactly, otherwise it will not work! Your text
area should now read "IISADMIN" on the first line, and "ColdFusion MX
Application Server" on the second line. Click "OK".
9) Close the Registry Editor.
10) Restart your computer (the web server).

This will now make the W3 Publishing Service dependent on both: the IISADMIN service, and the ColdFusion MX Application Server service. When the operating systems boots, the W3 Publishing service will not start until AFTER each of the other two services have successfully started. This will
solve your ColdFusion MX/Intregrated Windows Authentication problem, and let you comfortably rest at 3 a.m., knowing that if your server ever has to be rebooted, all your web applications will be secure.

July 2, 2003
Christian Cantrell has a post on his blog that explains how to find out full details about the underlying implementation of coldfusion datatypes. Check it out.....

June 27, 2003

Argumentcollection for UDFs/CFCs works like attributeCollection for custom tags.

<cfset a = structNew()>
<cfset a.mode = foo>

<cfset z = someCFC.methodName(argumentCollection=a)>

June 11, 2003

This article from the Macromedia Devnet discusses how to impelment Apache Jakarta Struts within ColdFusion MX. By implementing Struts, ColdFusion MX offers a Model-2 Model-View-Controller (or MVC) environment for ColdFusion applications. This article is based on an implementation that uses ColdFusion MX Enterprise Edition on a Windows server...more

June 4, 2003
Together at last: Sharing session data between ColdFusion and J2EE components 
Fuse disparate worlds with Macromedia ColdFusion MX for IBM WebSphere

June 3, 2003
Implementing Multi-Tier Hardware Load Balancing with ColdFusion MX for J2EE on JRun....more

May 29, 2003

If an application will be deployed on either CFMX Prof or CFMX for J2EE then you may run into an issue with URL's because of the context root. To keep this from happening prefix your URL's with the following code:


Sean Cornfield CFMX Coding Standards

Other CFMX coding links:
Variables in CFML
Reviving Super

Sean Corfield from CFCDev CFCs in Memory

Stick it in application scope. Use code like this in Application.cfm:

 <cfif not structKeyExists(application,"configObject")>
  <cflock name="myAppNameConfiguration" type="exclusive">
   <cfif not structKeyExists(application,"configObject")>
    <cfset application.configObject =
    <!--- any other initialization you need --->

Why the if/lock/if, you might ask? Race conditions. You want to ensure only one request actually initializes it.

Why put the unguarded if around the lock? The vast majority of requests will happen after the object has been initialized so you don't want the overhead of the lock on all requests.

Why put the if inside the lock as well? In case another request hit the outer if at the same time as this request and went ahead and locked and created the object. This way you're guaranteed not to initialize twice.

May 28, 2003

This one came from Spike Washburn, it shows what jar particular class is loaded from, it is usefull for issues on CFMX for J2EE:

<cfset resource="coldfusion/ColdFusion.class">
#resource#: [#resolveResource(resource)#]<br>

<cfset resource="org/apache/commons/discovery/resource/names/NameDiscoverers.class">
#resource#: [#resolveResource(resource)#]<br>

<cfset resource="org/apache/axis/discovery/DiscoverConstNames.class">
#resource#: [#resolveResource(resource)#]<br>

<cffunction name="resolveResource" returnType="string">
<cfset var resourceURL = getClass().getClassLoader().getResource(resource)>
<cfif isDefined("resourceURL")>
<cfreturn resourceURL>

<cfreturn "could not resolve resource">


This is usefull on CFMX for J2EE it will send debug output to the System.out of the application server:

<cfset call=SystemOutPrintln("Whatever you want to log to System.out.println")>

function SystemOutPrintln(debugdata)
sysout=CreateObject("java", "java.lang.System");
thisThread=CreateObject("java", "java.lang.Thread");
tst=sysout.out.println("#curThread# - #debugdata#");


Debugging database connections: The driver's class name and URL will have to be given driver-appropriate values:

class = createObject("java", "java.lang.Class");
// if this fails you'll get a Class Not Found exception; the driver is not properly in the classpath:
dm = createObject("java","java.sql.DriverManager");
// if this fails you'll get a driver-specific message
con = dm.getConnection("jdbc:mysql://localhost/test","[username]","[password]");
st = con.createStatement();
// from here you can run some query that returns a string value in the first column:
resultSet = st.executeQuery("SELECT * FROM TEST");
// this code will loop through and display the values in the first column of the resultset:
while( {
writeOutput(resultSet.getString(javaCast("int", 1)) & "<br>");
< /cfscript>

  When troubleshooting issues on other appservers with the J2EE version you may need to look into the users classpath and java.library.path (in order to get verity, cfgraph, and com support to work). Here is a little code that spits out a ton of information including the classpath and other info. Here is a sample of the information it dumps out.
Get the System Properties:
< cfobject type="java" name="sys" class="java.lang.System" action="create">
< cfset properties=sys.getProperties()>
< cfdump var="#properties#">

This is an example for ColdFusion and Flash Remoting. If you want a full set of example using CFLOGIN click here.

Do you want to know how to use ColdFusion's built-in authentication mechanism with ColdFusion components and Flash Remoting. ColdFusion and Flash make it very easy.

First of all, CFC functions have an optional "roles" attribute which you can use to limit access to that specific function. So the first thing you do is specify a coma-delimited list of roles which are valid for your function. The example function I wrote is below:

    <cffunction name="getDate"
        <cfreturn #now()# />

The next thing you do is use the setCredentials function on a NetConnection instance in ActionScript. Example code below:

var gw = "http://localhost/flashservices/gateway";
var con = NetServices.createGatewayConnection(gw);
// username and password are text fields... 
con.setCredentials(username.text, password.text);
var serv = con.getService("com.macromedia.tests.auth_test", this);

The last thing you have to do is map your username and your password to one or more roles, which you do using cflogin and cfloginuser. I put the following code in an example Application.cfm file:

<cfapplication name="authTest" />
    <cfif isDefined("cflogin")>
        <cfif eq "someUsername" and
              cflogin.password eq "somePassword">
            <cfloginuser name=""
                         roles="admin" />

That's all you have to do. (thanks to Christian Cantrell)

Also see

May 23, 2003

The Updater1-3 installers and later are built using Zero Gs InstallAnywhere.  The following URLs provide debug information

To enable Seguelink debugging:

1. Stop the ColdFusion MX ODBC Agent and ColdFusion MX ODBC Server service

2. Delete any log files in the C:\CFusionMX\db\slserver52\logging directory.

3. Start theColdFusion MX ODBC Agent and ColdFusion MX ODBC Server service.

4. Open up a command prompt and cd to CFusionMX\db\slserver52\admin.

5. Type the command swcla -l ( This changes the prompt to swcla> )

6. Enter the following:

sdll "ColdFusion MX ODBC Server" debugging=on fatalerror=on ssppackets=on ssprequests=on warnings=on errors=on informationals=on

7. Enter sdll "ColdFusion MX ODBC Server" ( This should output a table like the following verifying the loglevel state )
Debug log level for ColdFusion MX ODBC Server
Level State

fatalerror on
errors on
warnings on
informationals on
debugging on
ssppackets on
ssprequests on

8. Run the query or test ( This creates a "ColdFusion MX ODBC Server_xxx.log" in the C:\CFusionMX\db\slserver52\logging directory )

Note: The above log files created with debugging grow quickly so debugging should be disabled after the test.

9. Stop the ColdFusion MX ODBC Agent and ColdFusion MX ODBC Server service

10. Start the ColdFusion MX ODBC Agent and ColdFusion MX ODBC Server service

11. Open up a command prompt and cd to CFusionMX\db\slserver52\admin.

12. Type the command swcla -l ( This changes the prompt to swcla> )

13. Enter the following:

sdll "ColdFusion MX ODBC Server" debugging=off fatalerror=off ssppackets=off ssprequests=off warnings=off errors=off informationals=off

<cfset o = createObject("component", "mycfc")>

<cfdump var="#getMetaData(o.myFunc)#"><!--- myFunc is a member function of mycfc --->

One of the keys returned is "returnType"

May 22, 2003

In the J2EE version many times on Windows you will need to install the SequeLink services after you install CFMX for J2EE. Instead of reinstalling CFMX for J2EE you can run the following code and it will install the services for you.  Just copy it to a .cfm page, modify the <cfset cfusionWar=""> to the \cfusion directory where you deployed CF and invoke the script.  It will trigger the installer for the SequeLink product and add the necessary entries to your registry.

One note, before this will work you need to have the /WEB-INF/cfusion/lib added to your jvm.config in order for cfregistry to function properly.  Open up jvm.config and it should look something like this:

java.library.path=C:\\appservers\\JRunCFMX\\servers\\cfmx\\cfusion\\WEB-INF\\cfusion\\lib (after modifying restart JRun)

<!--- remove the services before running this script by running the \cfusion\WEB-INF\cfusion\db\SequeLink Setup\RemoveSequeLink.bat --->

<!--- set this to the location of your cfusion directory --->
<cfset cfusionWar="C:\appservers\JRunCFMX\servers\cfmx\cfusion">

<!--- install sequelink --->
 <cfexecute name="#cfusionWar#\WEB-INF\cfusion\db\SequeLink Setup\Setup.exe" arguments='!TargetDir="#cfusionWar#\WEB-INF\cfusion" !DoDNS=true'></cfexecute>

   BRANCH="HKEY_LOCAL_MACHINE\SOFTWARE\Macromedia\Install Data\ColdFusion MX"
     ENTRY="SqlLink" TYPE="String" VALUE="#cfusionWar#\WEB-INF\cfusion\db\slserver52">

 <cfcatch type="Any">
  <cfoutput><font color="red">Error Occured:</font> #cfcatch.message#<br>#cfcatch.detail#<p></cfoutput>

UPDATE 10/14/2003 - If you are using this on CFMX 6.1 standalone then you should be able to use the same code with a few changes.  I have not tried this yet but it should work

<!--- remove the services before running this script by running the \cfusion\WEB-INF\cfusion\db\SequeLink Setup\RemoveSequeLink.bat --->

<!--- set this to the location of your cfusion directory --->
<cfset cfusionHome="C:\CFusionMX">

<!--- install sequelink --->
 <cfexecute name="#cfusionHome#\db\SequeLink Setup\Setup.exe" arguments='!TargetDir="#cfusionHome#" !DoDNS=true'></cfexecute>

   BRANCH="HKEY_LOCAL_MACHINE\SOFTWARE\Macromedia\Install Data\ColdFusion MX"
     ENTRY="SqlLink" TYPE="String" VALUE="#cfusionHome#\db\slserver52">

 <cfcatch type="Any">
  <cfoutput><font color="red">Error Occured:</font> #cfcatch.message#<br>#cfcatch.detail#<p></cfoutput>

May 20, 2003
Sean Corfield has a page with several  publicly available CFMX bloggers

May 14, 2003

Creating an "other" driver using the connection string:

Stored Procedure Example:

(WHATEVEROUT out ref_cursor_pkg.ref_cursor_type,
WHATEVERIN in varchar2)
sql_st varchar2(1000);
sql_st := 'SELECT SYSDATE mydate FROM DUAL';
open whateverout for sql_st;

The Package for the refrence cursor data type.

CREATE OR REPLACE PACKAGE "REF_CURSOR_PKG" is type ref_cursor_type is ref cursor; end REF_CURSOR_PKG;

CF Code

<cfstoredproc procedure="test_pro" datasource="yourDS">
     <cfprocparam type="In" cfsqltype="CF_SQL_VARCHAR" dbvarname ="whaterin" value="Hello" null="No">
     <cfprocresult name="Whateverout">

May 9, 2003
Both ColdFusion MX and JRun4 will provide support for Microsoft's newest operating system, Windows 2003. This TechNote will discuss the availability of this enhancement to these Macromedia server products....more
See the latest technote at

May 8, 2003
As part of the ongoing Conversations series, Jeremy Allaire is interviewed about ColdFusion, the web and the future of wireless.

May 6, 2003

This week, DevNet continues the database theme with the "Advanced Database Development." Readers will dissect a hybrid ColdFusion/Java app built on ColdFusion MX for J2EE/JRun, learn how to package database transactions to ensure data integrity, improve RIA performance through Flash Communication Server MX, build an OO-based user interface with CFCs, and improve app performance by caching queries and content. Ben Forta steps in to guide developers in taking their next step with databases and development, too.

There's new Director content and John Dowdell and Jon Duran report the community's reaction to Macromedia Central.

Check out DevNet:
Ben Forta on Advanced ColdFusion: Simplicity Is Just the Start of It
Ben Forta
A Case Study: Building ColdFusion MX and J2EE Hybrid Applications
Drew Falkman
Controlling Database Transactions in ColdFusion MX
Simon Horwith
Improving Performance of Rich Internet Applications with Flash Communication Server MX
Giacomo 'Peldi' Guilizzoni
Building an Object-Oriented User Interface in ColdFusion MX
Dave Friedel
Caching in ColdFusion
Matt Boles
Integrating Digital Video in Director
2D Collision Detection Using Polygon Armatures
Andy Phelps
Macromedia Central: Initial Reaction
John Dowdell
Macromedia Central: A Huge Response
Jonathan Duran
Tech Sales Blog

Macromedia Sales Engineers


April 30, 2003
If you haven't visited Hal Helms (Team Macromedia Member) and you are a ColdFusion developer then you are missing some great tutorials.  The tutorials include many usefull topics, an introduction to using sessions in CF, multidimensional arrays, structures, mappings, Fusebox, and many other coding tips that can improve your quality of code in CF.  Check them out.…

April 24, 2003

Hi Brandon,

When I've received this email yesterday, I've finally decided to write an
ImageJ CFC wrapper (last year, I only wrote a small Imaging UDF lib based on
So many people are asking for a decent native Imaging package in ColdFusion

You'll find the CFC attached.
Consider it as a beta version...

In the zip, there is also :
- ImagingApp.cfm, a small imaging application that allow you to test the
ImageJ API locally (on the server),
- ImageJ.htm, CFC documentation.

To get ij.jar :

ImageJ CFC methods :
- input : open (support tiff, dicom, fits, pgm, png, jpeg, bmp and gif
- output/Conversion : save, saveAs, saveAsTiff, saveAsZip, saveAsGif,
- region of interest : setROI, resetROI
- manipulation : rotateLeft, rotateRight, flipHorizontal, flipVertical
- filters : invert, findEdges, medianFilter, smooth, sharpen, erode, dilate,
- drawing : setColor, setFont, setLineWidth, moveTo, lineTo, drawPixel,
drawLine, drawRect, drawString, fill
- size : resize, crop, scale

Example to resize an image :
image = createObject("component","ImageJ");"d:\anImage.jpg");

Any feedbacks (and probably bugs reports) are welcome.
Once it will be more or less bug-free, I'll put it online on and on

Have fun!

Benoit Hediard

When creating or configuring a data source in Macromedia ColdFusion MX and the verification process fails the error information is not very verbose. To diagnose these issues download the jar from the following technote:

I spent several weeks working with the team tuning and load testing the servers and applications.  It was a memorable experience.  I documented some of our experiences in an Under-the-Hood feature on the website.  This report explores the steps Macromedia took to tune, load test, and cluster the site to prepare it for the go-live date. ...full article


  1 2 3 4 5 6
7 8 9 10 11 12 13
14 15 16 17 18 19 20
21 22 23 24 25 26 27
28 29 30 31      

Subject Archives
Amazon EC2 (15)
ColdFusionMX (155)
Corvette (3)
Flash Lite (4)
Flash Media Server (5)
Flash Player (3)
Flex (39)
General Web Dev (14)
HDTV (3)
Jboss (1)
Jquery (2)
JRun (59)
Max 2003 (3)
Other (33)
PC Hardware (16)
Software (17)
SpatialKey (7)
Wireless (8)
Working Out (1)

RSS Feed
Feed Listing
Corvette - October 2005 brandonpurcell's Corvette - October 2005 photoset
Macromedia ColdFusion MX

Featured Links
Stock Footage
Page Render Time:0 user:""