Wednesday, March 19, 2003

Updater 3 requires recompilation of all templates: be aware of a few things, and here's a better compiler

One of the things updater 3 does is change the underlying compiler in CFMX. As such, the installer needs to clear out all the existing compiled class files in the cfusionmx\wwwroot\WEB-INF\cfclasses directory (note that's cfclasses, not classes). The good news is that the installer is supposed to solve that problem by simply renaming your current cfclasses directory to cfclasses_backup.

There are a couple of ramifications of this to be aware of:

1) this means that all first attempts to run CF templates will experience the delay of compiling (which happens only once when code is created or edited, but now needs to happen this once because to CF, it appears to be new code)

2) MM points out in the release notes you can help alleviate that burden by precompiling the code. This is new, as previously the only precompilers were those that folks passed around to each other (as I have in the past). They discuss this issue and their compiler in the release notes, specifically at this point,

3) The precompiler they use is pretty simplistic. It only compiles code "under the web root". That may not suit you. So I have a more complete compiler in my 12/10/02 entry.

4) If you experience any strange errors, it would probably be safe to simply rename the cfclasses directory or delete it (while the CFMX service is stopped). On restarting it, CFMX will create the cfclasses directory when you first execute a CF template.

Installing the Updater: One caution about CFIDE location

This isn't really new for the CFMX updater, but it's something worth paying attention: when installing the CFMX updater, pay attention to the step where you indicate the location of the CFIDE directory. This is where the administrator is located, as well as the RDS and CFC exploring features and the javascript and java files for CFFILE and more.

Anyway, the point is that if you install CFMX with the built-in web server, and then upgrade to using IIS or Apache, you may find that you end up moving the CFIDE out of the cfusionmx\wwwroot to the inetpub\wwwroot. Or you may choose to move it elsewhere for other security reasons.

Anyway, the installer (in my case at least) does not detect that I no longer have CFIDE in the CFusionMX directory, yet it tries to put it there by default. I was aware of this issue and changed the installer during that step to point to the correct location where I have the CFIDE. The problem is that you may not notice this.

Now, someone suggested that the installer wouldn't have let me proceed if I had let the installer try to put the CFIDE in a directory where it didn't already exist. Fair enough. But what if you had copied rather than moved the directory to the new location (as you might when changing from the built-in web server to IIS/Apache, not worrying about it remaining in the cfusionmx\wwwroot where it shouldn't be executed anyway)?

Again, this is just a warning in case the problem might strike anyone else.

Updated version of CFMX Version Checker

Folks, I've got an updated version of my CFMX version checker that I'd last offered on 1/29. This one accounts for the new Updater 3. Save it as getCFMXVersion.cfm and run it in your environment. Enjoy.


<!---
Name: getCFMXVersion.cfm
Author: Charlie Arehart
Version: 3/26/03
Published in the May 2003 CFDJ
--->
<h2>CF Version Analysis:</h2>

<cfscript>
versinfo = arraynew(1);
versinfo[1] = structnew();
versinfo[1].name = "the base version, with no updater";
versinfo[1].number = 48097;

versinfo[2] = structnew();
versinfo[2].name = "Updater 1";
versinfo[2].number = 52311;

versinfo[3] = structnew();
versinfo[3].name = "Updater 2";
versinfo[3].number = 55693;

versinfo[4] = structnew();
versinfo[4].name = "Updater 3";
versinfo[4].number = 58500;

curversion = listlast(Server.ColdFusion.ProductVersion);
</cfscript>

<cfoutput>
This server is running <b>#Server.ColdFusion.ProductName#, #server.coldfusion.ProductLevel#</b>
<p>
The current version number is <b>#Server.ColdFusion.ProductVersion#</b>
<cfif left(Server.ColdFusion.ProductVersion,5) is "6,0,0" >
which means it's running with
<cfif server.coldfusion.appserver is "j2ee" and curversion is 58096>
Updater 3 on ColdFusion MX for J2EE.
<cfelse>
<cfloop from="1" to="#arraylen(versinfo)#" index="i">
<cfif curversion eq versinfo[i].number>
<b>#versinfo[i].name#</b>.
<cfbreak>
<cfelseif curversion lt versinfo[i].number>
<b>patches not yet up to the final release of #versinfo[i].name#</b>
<cfbreak>
<cfelseif i is arraylen(versinfo)>
a version <b>greater than the final release of
#versinfo[arraylen(versinfo)].name#</b>.
This tool has not been updated yet to recognize that version number.
</cfif>
</cfloop>
</cfif>
<cfelse>
<!--- there were no updaters for CF 5 or before, so there's no reason to try to report on them
prior to CFMX, and this program will not report on any version greater than CFMX
(productversion > 6) --->
</cfif>
<p>
There are updaters for CFMX available at
<a href="http://www.macromedia.com/software/coldfusion/special/updater/faq/">
http://www.macromedia.com/software/coldfusion/special/updater/faq/</a>.
</cfoutput>





Actually, the code above is yet another update over a version (below) that I'd first offered here in this posting on 3/19. The version above is just a little better organized than the code below. They produce the same result.I offer the code below for "posterity". :-)



<cfoutput>
<h2>CF Version Analysis:</h2>

This server is running <b>#Server.ColdFusion.ProductName#, #server.coldfusion.PRoductLevel#</b>
<p>
The current version number is <b>#Server.ColdFusion.ProductVersion#</b>
<cfif listfirst(Server.ColdFusion.ProductVersion) is 6>
   which means it's running with
   <cfif listlast(Server.ColdFusion.ProductVersion) le 48097>
     <b>no updater</b>.
   <cfelseif listlast(Server.ColdFusion.ProductVersion) lt 52311>
     <b>patches above the base version but not yet up to the final release of updater 1</b>.
   <cfelseif listlast(Server.ColdFusion.ProductVersion) eq 52311>
     <b>updater 1</b>.
   <cfelseif listlast(Server.ColdFusion.ProductVersion) lt 55693>
     <b>patches above updater 1 but not yet up to the final release of updater 2</b>.
   <cfelseif listlast(Server.ColdFusion.ProductVersion) eq 55693>
     <b>updater 2</b>.
   <cfelseif listlast(Server.ColdFusion.ProductVersion) eq 58096 and Server.ColdFusion.ProductName contains "j2ee">
     <b>updater 3 for #Server.ColdFusion.ProductName#</b>.
   <cfelseif listlast(Server.ColdFusion.ProductVersion) lt 58500>
     <b>patches above updater 2 but not yet up to the final release of updater 3</b>.
   <cfelseif listlast(Server.ColdFusion.ProductVersion) eq 58500>
     <b>updater 3</b>.
   <cfelse>
     a version <b>greater than the final release of updater 3</b>. This tool has not been updated yet to recognize that version number.
   </cfif>
  <cfelse>
     <!--- there were no updaters for CF 5 or before, so there's no reason to try to report on them prior to CFMX, and this program will not report on any version greater than CFMX (prodcutversion > 6) --->
  </cfif>
<p>
There are updaters for CFMX available at <a href="http://www.macromedia.com/software/coldfusion/special/updater/faq/">
http://www.macromedia.com/software/coldfusion/special/updater/faq/</a>.

</cfoutput>

Updater 3 for CFMX is Out

Updater 3 for CFMX is out. I'll have more news to share soon on some surprising hidden gems in the updater.

CFMX Updater 3 Released March 20, 2003
http://www.macromedia.com/software/coldfusion/special/updater/faq/

CFMX Updater3 Release Notes
http://www.macromedia.com/support/coldfusion/releasenotes/mx/releasenotes_mx_updater.html