ColdFusion Muse

Cfexecute: Upgrading from Coldfusion 6.1 to Coldfusion 8

Mark Kruger January 28, 2008 9:43 AM Coldfusion 8, Coldfusion Troubleshooting Comments (0)

Here's a tricky little bug that I missed during a recent upgrade. The customer had Coldfusion 6.1 and we were tasked with moving them to Coldfusion 8. After reviewing the code and determining that no changes would be necessary, we did the upgrade. After we were finished everything seemed fine except one obscure task that was set up to run periodically. It was a command line task using Cfexecute. The task accessed the mysqlump.exe file to create periodic backups of the mysql database. The code (which was working on CF 6.1) looked like this:

<cfexecute
    name="#pathvar#/mysqldump.exe --opt #var1# --user=#var2# --password=#var3#"
    outputFile="#var4#"
    timeout="120">

</cfexecute>
Now I'm not a huge fan of cfexecute. I usually find some other way to run command line programs. But I have seen code exactly like this work before so I did not think to check the syntax. After the upgrade we began to get a "file not found" type of error. We looked at file permissions. We changed the path to remove spaces. We even tried the Joliet style path and name (as in c:\progra~1\....) but to no avail. Our customer, a Coldfusion programmer in his own right, was looking through the docs and noticed that the "arguments" attribute was a part of the docs but missing in our previously working example. He changed the code to look like this:
<cfexecute
    name="#pathvar#/mysqldump.exe"
    arguments="--opt #var1# --user=#var2# --password=#var3#"
    outputFile="#var4#"
    timeout="120">

</cfexecute>
...sure enough it started working.

So if you are troubleshooting Cfexecute after an upgrade to 7 or 8 and you are getting missing file exceptions and scratching your head. Check to see if you are using the old style Cfexecute syntax where the executable and the arguments are all on the same line and passed in the "name" argument. If you are, take the "arguments" portion of the command line and move them to the "arguments" attribute of the cfexecute tag. That might do the trick.

  • Share:

I'm a Cfcapricorn

Mark Kruger December 28, 2007 7:29 PM Coldfusion Troubleshooting Comments (12)

I'm a Cfcapricorn

Ever so often an uber-geek Coldfusion programmer will ask me the question, "so.... what's your favorite Coldfusion tag?" It reminds me of a barfly asking "what's your sign". Nobody ever asks about my favorite CF function (I think I like "isValid( )" - very chic). As for my favorite tag, there are so many to choose from. Cfinvoke is a powerful, as is cfimport. Of course little actual work is ever done in CF without Cfquery. Cfcomponent and Cffunction earn high marks as well. But if you want to know my all time favorite tag I would have to say there are 2 tags that are more important and more useful than any other. In fact, I would say that the effective use of these two tags has made me into the Coldfusion Guru evangelist that I am today. If it wasn't for these 2 tags, people would not flock to my 72 Oldsmobile when I pull up at the quickie mart. I would not be able to afford that cubic zirconium ring I purchased for my lovely wife - and the Hottentots would just seem un-hot. Let me just step into the pulpit and tell you about them.

(Note: I've been sick and taking medication so please forgive me for the following)

Read More
  • Share:

Multiple Garbage Collectors: Can Two Sanitation Engineers be Better Than One?

Mark Kruger November 29, 2007 1:48 PM Coldfusion Optimization, Coldfusion Troubleshooting Comments (2)

I ran across this JVM configuration on a server recently. I should note that the server in question was having some issues, so this is not an endorsement of this approach. I simply had not seen this sort of configuration on a Coldfusion server before. Here are the JVM arguments:

java.args=-server -Xms512m -Xmx768m -Dsun.io.useCanonCaches=false -XX:MaxPermSize=192m -XX:PermSize=64m -XX:NewSize=48m -XX:+UseParNewGC -XX:+CMSParallelRemarkEnabled -XX:+UseConcMarkSweepGC ...
What seemed unusual to me is that this particular set of arguments allows for 2 garbage collectors to be specified. Both the "UseParNewGC" switch and the "UseConcMarkSweepGC" switch are set. I did not know that multiple GCs could be specified. I set about finding out how this was possible.

Read More
  • Share:

Branch Target Offset Error

Mark Kruger September 28, 2007 2:06 PM Coldfusion MX 7, Coldfusion Troubleshooting Comments (3)

Recently I got an error I had never seen before. That's news in itself. This error was especially cryptic. The template in question made a CreateObject() call to a CFC that was quite lengthy. In fact, this CFC was over 2000 lines of code (Coldfusion 7). When it tried to compile the code it threw an error that said branch target offset too large for short. You know you are a true geek when seeing an error you have never seen before raises your pulse. I started hunting for a solution - and I found one.

Read More
  • Share:

One Way to Easy Recovery of a Crashed Server

Mark Kruger September 6, 2007 9:40 AM Coldfusion MX 7, Coldfusion Troubleshooting Comments (3)

Everyone should have regular backups and a plan for restoring a server if something goes wrong. But let's say, for the sake of argument, that you have a problem with a server where all you have is the old drive with the Coldfusion install directory (c:\cfusionmx7\ for the sake of our scenario). If you have to do a reinstall, is there a way to get back all that careful tuning, datasources (there can be a lot of these), debugging IPs, settings, CFX tags, Mail settings, etc.? Actually it is not as hard as you think.

Do a fresh install to the same location as before (C:\CfusionMX7 in this case) being careful not to overwrite the old directory. You may need to rename that old directory if you are using the same drive over again. Once CF is completely installed and running, stop the server and any associated services like search, odbc server etc. Then install the "old" directory over the new. Use a rename if you like. The main issue is that the old directory should replace the new. Restart the services and log into the CF admin. If the admin fails to come up may have to rerun the "connector" script for your web server (found in CfusionMX7/bin/connetors). These magic scripts set ports and other things that "hook" your Coldfusion server into your web server.

Now before you add mean comments please know that I am aware there are other ways of doing this. You can grab several config files and anything that is an XML file from the old directory and simply copy them into the new directory and it will work. You can use wsconfig to recreate the services - possibly without a reinstall. I'm sure there are clever people out there that have all kinds of nifty tricks. This is just one trick that takes care of this scenario. But this trick is especially useful when you have to walk an inexperienced tech through it over the phone. The concepts are easy to understand and easy to guide someone through.

  • Share:

Trusted Cache and Debugging

Mark Kruger July 18, 2007 2:21 PM Coldfusion Troubleshooting Comments (1)

Hello Muse readers. It's been a long time between posts and that's quite unlike me. I've been vacationing, traveling, and swamped with new business. My biggest headache at the moment is finding advanced developers to join my team so if you know anyone send them my name. We are a Coldfusion shop doing high level Coldfusion and Flex work and we need 2 advanced developers as we speak. We have great wages and benefits and Omaha is one of the top 10 places in the country to live - just ask my friend and neighbor Warren Buffet (ha). Meanwhile, here's today's tip.

Let's suppose you have a production CFMX server where trusted cache is turned on. At some point you have to do some quick troubleshooting due to an error so you also turn on debugging. In the debug information you see the error detail and you know exactly what to do to get it fixed. What's your next move? Of course, using CFEclipse or Homesite or (gulp) Dreamweaver you open the file and make a change - then you refresh the page. What happens? Actually 2 very contradictory things happen.

Read More
  • Share:

Which Updater Am I On? Determining the Coldfusion Version and Updater

Mark Kruger March 10, 2007 12:37 PM Coldfusion Troubleshooting Comments (0)

If you ever find yourself trying to support a server without knowing which updaters or hot fixes have been applied you will find this link a very useful. It includes this table:

6,0,0,48097 ColdFusion MX
6,0,0,52311 ColdFusion MX + Updater 1
6,0,0,55693 ColdFusion MX + Updater 2
6,0,0,58500 ColdFusion MX + Updater 3
6,1,0,63958 ColdFusion MX 6.1
6,1,0,xxxxx ColdFusion MX 6.1 + hot fix
6,1,0,83762 ColdFusion MX 6.1 Updater
7,0,0,91690 ColdFusion MX 7
7,0,1,116466 ColdFusion MX 7.0.1
7,0,2,142559 ColdFusion MX 7.0.2


Go look in the "system information" page for the version number and match it to the table.

As for hotfixes, once you know the updater you will have to search through the class path listed under system information for the specific hot fixes deployed. They all start with "hf".

  • Share:

IIS Wildcard Log Files Growing Too Large

Mark Kruger February 6, 2007 9:41 AM Coldfusion Troubleshooting Comments (1)

Muse Reader Elliot Kayne Asks:
I have a CF 7.2 server and it is creating huge jrun_iis6_wildcard logs. Everyday I see 2gig log files. It is burning up drive space. How do I stop this crazy thing?

In case you are wondering the log files in question are hidden in the /cfusionmx7/runtime/lib/wsconfig/ directory. You will see numbered directories in there - possibly one for each site depending on your configuration. inside the numbered directory will be a sub-directory called "LogFiles" and inside of the logfiles directory is a set of, you guessed it, log files. These files log operations associated with the wildcard ISAPI filter. Elliot’s log files where growing quite large on a daily basis.

Read More
  • Share: