Quick Fix for ColdFusion Builder 2 Problem after Install

I recently upgraded my ColdFusion Builder install to ColdFusion Builder 2 and was unable to get it to start. Every time I tried to start it, it would momentarily open and then immediately close down. There was no error message or anything else to help figure out what the problem was. I searched the web for a solution but was unable to find an answer, or even someone else with the same problem.

Now, before someone points out the obvious, I did read Adobe’s documentation on Installing ColdFusion Builder 2 and found it quite useful. It would have been much more useful if I had read it before I installed the upgrade. Within it, I found this gem:

If you are using ColdFusion Builder with a workspace from a Beta release, clean and reinitialize the workspace before installing the release version of ColdFusion Builder. In general, when you use existing workspaces with a new installation of ColdFusion Builder, Adobe recommends that you clean and reinitialize your workspace before the installation.

I didn’t really have the Beta version installed but it was a useful clue as to why my install wasn’t working. Unfortunately, I had already done the install so any cleanup and re-initialization now was a moot point. However, I was all for avoiding an uninstall and re-install on my machine so I went hunting for a quick fix to the workspace problem. After some digging, I found my solution.

Here’s what I did. When the program installs, it adds a configuration folder to the following location (this is the default for Windows XP; you may need to search around for your specific OS and version):
D:\Documents and Settings\username\Adobe ColdFusion Builder 2.0 Configuration\configuration

Under the .settings folder is a file called org.eclipse.ui.ide.prefs. Here’s what it looks like:

#Fri Aug 26 21:24:26 CDT 2011
RECENT_WORKSPACES_PROTOCOL=3
MAX_RECENT_WORKSPACES=5
SHOW_WORKSPACE_SELECTION_DIALOG=false
eclipse.preferences.version=1
RECENT_WORKSPACES=D\:\\Documents and Settings\\username\\Adobe ColdFusion Builder workspace

Notice that the recent workspace listed matches the default workspace for ColdFusion Builder 1. This is what is causing the problem. I just changed the RECENT_WORKSPACE line to:

RECENT_WORKSPACES=D\:\\Documents and Settings\\username\\Adobe ColdFusion Builder 2 workspace

(Of course you can put in whatever you want as long as it is not your current ColdFusion Builder 1 workspace.)

I then saved the file and restarted ColdFusion Builder 2. Problem solved…

A note of warning, if you are going to do this, save a backup of this file before you change it. Also, this won’t work if you want to use the same workspace on both versions since you are changing the workspace here. If you try to change the workspace back to the previous workspace, the IDE will fail to start again. However, I was able to import a previous project to the new workspace just fine.

Of course, if you have yet to install the new version of ColdFusion Builder 2, do yourself a favor and read the installation instructions from Adobe before you install and don’t forget to clean and re-initialize your workspace. Don’t say I didn’t warn you.

Using cfheader to redirect content in ColdFusion

I just thought I’d share  a few things I discovered about doing content redirection with cfheader to save you the time it took me to get this to work.

I recently had a need to improve my website’s handling of missing pages following a large content overhaul. I didn’t just want to use one file for all 404 errors. Instead, I wanted to properly handle permanent redirects, deleted content, and other changes that may impact users who had links to old content. Since we use ColdFusion 8, we are using the application.cfc file along with the onMissingTemplate function to handle these redirects for the entire site. Most examples I’ve seen use ColdFusion’s cflocation tag to redirect the page request; however, this was not the ideal option because it only allows setting of the http status code to one of the 3xx codes. This is OK for a temporary or permanent redirect but not really correct for a redirection to an error page.

Since SEO best practices dictate that you use status code 404 for cases where the cause of the missing page is unknown and instead use the most appropriate code  based on the status of the page, I set out to find information about how to do redirects using the cfheader tag. What a headache! Most examples out there suggest, incorrectly, that you just need to add something like this to the handler:

Wrong:

  <cfheader statuscode="410" statustext="Gone">
  <cfheader name="Location" value="/removed.cfm">

I spent tons of time trying to figure out, rather unsuccessfully, why this code did not work. No matter what I tried, I could not get the browser to redirect to the error page. Finally, after much testing and trying different things, I found what I was looking for on Pete Freitag’s blog. I was missing an important tag to get this to work: the cfabort tag. The correct code is as follows:

Right:

 
  <cfheader statuscode="410" statustext="Gone">
  <cfheader name="Location" value="/removed.cfm">
  <cfabort>

If you plan to implement something like this, it helps to know some of the most useful http codes. Below is a list of examples for some of the most common codes. For a complete list of http status code, I suggest you go to http://www.w3.org/Protocols/rfc2616/rfc2616-sec10.html.

Permanent Redirect:

 
 <cfheader statuscode="301" statustext="Moved Permanently"> 
 <cfheader name="Location" value="/moved.cfm">
 <cfabort>
  

Temporary Redirect:

 <cfheader statuscode="307" statustext="Temporary Redirect"> 
 <cfheader name="Location" value="/temp.cfm">
 <cfabort>
   

Content Permanently Removed:

  
 <cfheader statuscode="410" statustext="Gone">
 <cfheader name="Location" value="/removed.cfm">
 <cfabort>
 

See Apollo Moon Rocks on Google Moon

This is still very much a work in progress; however, we have just made available a Google Moon file showing data and photos of moon rocks collected during the Apollo 15 and 16 missions. Download the file from http://curator.jsc.nasa.gov/lunar/moon/. If you have any comments or suggestions, let me know.

Welcome to my blog!

I’ve decided to bite the bullet and get a blog started. After years of benefiting from other people’s blog treasures, it is time for me to share a few of the things I’ve figured out along the way. It is often a random blog somewhere that has helped me figure out how to solve a nagging problem, or at least helped me feel less alone when I see how many people have the same problem. Hopefully, I’ll be able to share something of use to someone else.

Follow

Get every new post delivered to your Inbox.