≡ Menu

Scheduled Tasks and Anonymous Access in ColdFusion 11

I have been converting applications from ColdFusion 8 to CF 11 over the last several months, and some of the challenges have been quite a bit more daunting than this one. Even so, I felt this was worth mentioning.

After copying all the code for my most recent upgrade candidate from the old server to the new one and setting it up in IIS, I proceeded to set up the CF Scheduled Tasks on the new server.

One of the tasks that I set up runs under a blank user name. In order for that to work, you have to make certain that several settings related to authentication are set properly in IIS. First of all, if the app as a whole runs under anything other than Anonymous Authentication (such as Windows Integrated Authentication or Forms Authentication), your Scheduled Task URL will have to be inside a folder that has Anonymous Authentication enabled, even if it’s turned off for the rest of the app.

Secondly, you have to make sure that the “jakarta” virtual folder that is set up during IIS configuration of the website also has Anonymous Authentication enabled.

Having Anonymous Authentication disabled on the jakarta folder will cause no end of irritation if you don’t have the output of the URL sent to a file, as neither the application log file nor the Security log in Windows Event Viewer will tell you exactly why the task is failing. If you send output to a text file, you can rename that text file with an HTML extension (I’m still not sure why Adobe doesn’t just allow output as HTML for this…) and then see more clearly why your task was failing.

IIS authentication error

So set your authentication properties correctly to avoid this frustration!

Windows Disks Keep Filling Up with Small Log Files

I noticed that a Windows server I use for development with Visual Studio 2013 Ultimate had begun filling its system drive with log files in C:\Windows\Temp for no apparent reason.

The initial response of our infrastructure group was to simply delete the log files on a weekly basis, as no one could find the cause of the problem. Since this issue was apparently in the purview of that group, I let this solution stand initially. However, as I feared, the problem became worse and the server began crashing on a weekly basis.

The log files had many messages that contain “Product: Microsoft Visual Studio Professional 2013 — Configuration completed successfully.”

I wasn’t sure that the log files were the cause of the crashes, but it became apparent that the two were likely connected when I saw many similar errors in the Application log under Event Viewer: “Detection of product ‘{9C593464-7F2F-37B3-89F8-7E894E3B09EA}’, feature ‘Testing_Tools_for_Pro_x86_enu’, component ‘{55E69908-5292-4B15-A56D-822A6050848F}’ failed. The resource ” does not exist.”

Application log entry

There are a couple of fixes that should be applied here. The first is very simple. In all likelihood, a folder named “Microsoft.NETFrameworkURTInstall_GAC” is missing from the %SystemRoot% (usually C:\Windows) folder.

If this folder is, in fact, missing, add it using either
1.an elevated Command Prompt with this command:
mkdir %SystemRoot%Microsoft.NETFrameworkURTInstall_GAC
2. PowerShell:
mkdir $env:SystemRoot\Microsoft.NETFrameworkURTInstall_GAC

The second fix is to repair Visual Studio 2013 in the Control Panel.

Open Control Panel, open Programs and Features, select Microsoft Visual Studio 2013 [Professional/Ultimate/etc.], click Change, and click Repair on the VS splash screen.

In most cases, this will fix your problem.

Visual Studio 2013 continuously repairs producing many small log files

Missing Components After Moving a ColdFusion Site

Last week I was tasked with moving several of my applications from one CF 8 server to another one, due to the first server’s VM host having some kind of problem requiring daily restarts of the VM by our infrastructure team.

After moving two applications, the users began complaining that one of the functions in one of the applications that had previously worked perfectly was not working at all for some users now.

IE 11 Developer Tools window

IE 11 Developer Tools window showing debugger options

By opening Developer Tools in Internet Explorer (this is not a Chrome-compatible application), and setting the “Break on all exceptions” option in the debugger, I was able to begin troubleshooting the problem.

The exceptions in JavaScript that were being thrown dealt with missing classes, including declared ColdFusion components and ColdFusion.Ajax functions.

I remembered at that point that I had forgotten to do something that all ColdFusion developers should do on each application: to create the CFIDE virtual directory in IIS.

Once this simple task was done, everything worked as expected.

Ruby on Rails Tutorial and Screencasts for Rails 5 Are Available!

The new Rails Tutorial from Michael Hartl is available at his main site and also at Learn Enough.

RoR tutorial

Courses for Summer Learning

Two courses that have recently been made available (though I haven’t yet had the opportunity to take) at Code School are Powering Up With React (for React) and an HTML/CSS class called The Elements of Web Design.

Summertime – which is rapidly approaching – is a good time to commit to spending time picking up new skills and refreshing old ones. I have little experience with React, so this presents an excellent opportunity to see what capabilities are made available there.

learning new things

Whether you choose to take the above courses, or look elsewhere for learning, commit to spending a little time each day studying to pick up new skills – it may not sound like much effort to spend toward a large task, but the results could surprise you!

While I think the venerable Ruby on Rails Tutorial is still the best way to learn Rails, jumping into this tutorial can be challenging for those who are new to programming.

With the fourth and latest beta of Rails 5 being released this past week, it is appropriate that Michael Hartl, the creator of the Rails Tutorial, has devised yet another tool to help new and experienced developers learn enough to make the most of it.

Appropriately, the title of this site is “Learn Enough to Be Dangerous”.

current courses at Learn Enough to be Dangerous

As of the end of April 2016, only three “Learn Enough” courses are available: Command Line, Text Editor, and Git. However, future courses including HTML, CSS & Layout, JavaScript, Ruby, Sinatra, and the Ruby on Rails Tutorial for Rails 5 are scheduled to be added.

The cost is $29 per month, the same as Code School (if you subscribe on a per-month basis to CS). Unlike CS, there is not yet a discounted yearly rate.

Since I’m excited to see the new Rails Tutorial as soon as it’s released, I’ve decided to sign up. Were it not for the access to this mammoth resource, I don’t know that I would pay this price – but considering that the Rails Tutorial with screencasts generally costs about $150 by itself, it seems like a reasonable deal. At any rate, I’ve come to expect only the highest quality learning materials from Dr. Hartl, so I am definitely looking forward to the upcoming classes.

Changes in the ColdFusion.window.create Function Require a Modern Browser

I’m still working on upgrading some older CF8 applications to CF11. I came across an interesting problem, the exact cause of which I have not found, but I do have a solution of sorts.

When the particular application I’m working on now was written, the standard browser that would be accessing it was Internet Explorer 8. Over time, as we have upgraded our browsers, but not had time to make changes to the application to accommodate those new browsers, we had used the dreaded Compatibility View to keep the look and feel of the application unchanged.

Since we are now several versions out from CF8, it is understandable that some things intrinsic to ColdFusion have changed. Somehow, the way that the function ColdFusion.window.create renders JavaScript to create the pop-up window does not work with IE 8 or a newer browser emulating IE 8 (as we forced with the X-UA-Compatible HTTP header in IIS). After copying the website to the CF11 server, setting up everything in IIS, and navigating to the website, everything was great until I clicked on a link that executed a function (named “createCFWindow”, as in the dialog box below) that called the ColdFusion.window.create function.

This is the result:

error dialog box

After stepping through the code using Internet Explorer’s Developer Tools, I determined that the reason this “createCFWindow” function threw an exception was because the ColdFusion.window.create function was returning null rather than a new window.

When testing the website on Chrome – which this application was not designed to use – I discovered that the error did not occur, and decided to turn off Compatibility View. Sure enough, this error disappeared in IE 11 – though a host of other issues have now developed.

Now, I’m working to upgrade the application to be HTML5-compliant so it will work on IE 11 or Chrome.

Apparently, using CF UI tags became unfashionable quite some time ago, but that type of advice isn’t always heard or heeded until long after it’s announced.

Any future applications I build will use jQuery instead for this sort of thing.