Adam Tuttle

Entries Tagged as ColdFusion

Upgrading to OSX Yosemite with CF10 Already Installed

Yesterday morning I decided to take the plunge and upgrade my daily-driver laptop to OSX Yosemite. This is the story of what I did, what I could have done better, and how I dug myself out of that hole.

Before I made the decision I snooped around to see if anyone else had any trouble. By that I mean that I had already seen a relevant bug report and I asked on twitter:

I didn't put much stock into the bug report: It looks like it was written by someone that doesn't really know their way around a CF installer, and I like to think that I do (know my way around a CF installer). And the tweets were generally positive: You'll probably have to reinstall MySQL, and the built-in Apache install will probably get un-configured. Not that big of a deal, all in all.

So I dove in! Knowing that apache config would be mucked with, I was (1) very happy that I had checked it into a git repo a long time ago, and (2) made a backup copy in my home directory just in case. I also backed up all of my mysql databases. That should cover everything that wasn't backed up overnight with Backblaze.

The download went faster than when I upgraded my Mac Mini HTPC the other day (irony: the mac mini is on a wired connection and my laptop is on wifi...), but the installer took for-freaking-ever. When it got down to "2 minutes remaining" it was just about noon so I left it alone and went out for lunch. When I returned an hour later, it still said, "2 minutes remaining."

... Crap.

Not to worry, though, as this appears to be a pretty common problem, especially for people that have a lot of stuff in /usr/local/bin (homebrew, global node.js modules, etc) -- which includes me. So wait it out I did (I did hit Cmd+L to watch the log and confirmed it was actually working that whole time, so at least it wasn't just the dreaded beachball of death). At about 1:40 it finally finished installing, and I was able to use my laptop again.

The first thing I did was install updates for things I was prompted for; probably stuff that required Yosemite: a new version of 1Password, an iTerm update, and Keynote, iMovie, and iPhoto; as well as the updated Command Line Tools. Then it was down to business.

The first thing I wanted to do was verify that I could start CF and Apache and get to the CF Administrator. No complaints when I started them, but as expected, I was not able to get to the CF Administrator: 404.

I went through the diff of changes made to my httpd.conf file (thanks, git!) and adjusted things that made sense to me: re-establishing my preferred default document root, re-enabling my vhosts, adding the Include line for mod_jk that was removed, etc. But still, Apache never seemed to finish starting: there were no errors printed to stdout or stderr when I started it, but I never found httpd in the process list either. Then I found reference to apachectl configtest on Stack Overflow (you may or may not need to use sudo; I did), which does exactly what you should expect: it verifies that your apache configuration is at valid, syntactically and otherwise. I had a few problems. Firstly:

httpd: Syntax error on line 531 of /private/etc/apache2/httpd.conf: Syntax error on line 2 of /private/etc/apache2/modjk.conf: Cannot load /Applications/ColdFusion10/config/wsconfig/1/ into server: dlopen(/Applications/ColdFusion10/config/wsconfig/1/, 10): Symbol not found: _aplogerror\n Referenced from: /Applications/ColdFusion10/config/wsconfig/1/\n Expected in: flat namespace\n in /Applications/ColdFusion10/config/wsconfig/1/

My assumption here was that there's some problem with the webserver connector as built on OSX 10.9, so I commented that out. After doing that, of course, my JkMountFile lines in each vhost were the next problems:

AH00526: Syntax error on line 116 of /private/etc/apache2/extra/httpd-vhosts.conf:
Invalid command 'JkMountFile', perhaps misspelled or defined by a module not included in the server configuration

Commenting each of those out has made Apache successfully start, and I can now browse around my various vhosts, but obviously ColdFusion isn't running. I had run wsconfig at some point previously and it was crashing. I was hopeful that the problem had something to do with my mucked up Apache config, but alas, even once the config was cleaned up the web server connector continued crashing on startup.

Saddened, I downloaded a fresh copy of the CF10 installer and tried to uninstall my existing copy. The uninstaller crashed too. "Oh well," I thought, and figured I would rename the CF10 folder and install anew. The freshly downloaded installer crashes, too. Delightful!

Not that I particularly want it, but ColdFusion11 might work, since it's been released more recently. Since CF10 is still supported (*ahem*) you'd expect its installer to be able to run, but whatever. I downloaded CF11, hoping it would save me from having to reformat my laptop and stay up all night reinstalling stuff from scratch and... hallelujah, it runs!

Let's not get too excited just yet, though. The installer completes (with a very ugly dead give-away "this app was written with Java" dialog box for selecting the path of my existing CF10 installation for settings migration), and the CF Administrator loads! Hooray! I get to sleep tonight!

Mappings copied over and look right. Still don't have a mail server configured (this is how I want it, so check!). My MySQL datasources check out. MSSQL TBD: I need to run windows update in that VM and make sure it's still forwarding ports correctly, but it's not mission critical at the moment.

I did have to figure out where to drop in my Bcrypt.class file so that BCrypt will work (hint: /Applications/ColdFusion11/cfusion/wwwroot/WEB-INF/classes/), but all in all everything appears to be in working order. I'd still prefer to have CF10 installed to match my production servers, but I suppose this will have to do.

... That was not how I wanted to spend my Wednesday.

Published 2014-11-06 @ 09:00 in Apple ColdFusion

Introducing Zoidbox

A couple of episodes of CFHour ago, Scott made a joke that Luis (of ColdBox, TestBox, ..., *Box fame) should name his next product ZoidBox -- it didn't matter what it did, he just wanted a *Box product named in his likeness (Scott goes by BoyZoid in many places)...

I jumped at the chance, and created created Zoidbox, the IRC bot that attempts to bring the knowledge and wit of @boyzoid to ##coldfusion on freenode. (It's an IRC bot that does helpful and funny things in the chat.)

Over the next week or two other people have gotten involved, and what once was a shoddy script with a mish-mash of messy code has become something —dare I say— beautiful.

We refactored the core down to just a few lines of code and setup a system for plugins to be easily added. It's hosted on a free-tier heroku cloud instance, and uses continuous deployment: Any time one of us merges a pull request or pushes to the master branch, zoidbox is re-deployed automatically.

It's funny how the things that start out as a joke can become interesting, complex, and yes, beautiful. I'm really proud of the code we've put together for Zoidbox so far; and the work will probably continue for the foreseeable future. Not only is it fun to have the bot in the chat, it's fun to work on him.

Just one more reason you should join us in the ##coldfusion IRC channel!

Published 2014-10-13 @ 09:21 in ColdFusion Community

REALLY?! CFSpreadsheet Throws Exception When Column Name Contains a Comma

I don't even know where to start with this one. So let's just look at some code, shall we?

<cfspreadsheet action="read" src="someFile.xlsx" headerrow="1" />

Pretty simple, innocuous code, right?

Now, in your spreadsheet, create a column name with at least 1 comma in it. In my case: "Committees, Chapters, & Networks Selected"

If you're getting data from non-technical people, you're likely to get stuff like this — and really, there's no good reason not to support this behavior.

What does CF do with this?

[Table (rows 3 columns Username, Password, <snip>, Committees, Chapters, & Networks Selected, Education, <snip> ] is not indexable by COMMITTEES

It's pretty obvious what's going on here. Someone had the bright idea to use a comma-delimited list of column names when converting the imported spreadsheet file into a Query object; and my single column name "Committees, Chapters, & Networks Selected" now appears to be 3 distinct columns, and it can't find the data for them.

I am simultaneously gobsmacked and awestruck.

Raised 3825042.

This also happens to remind me of a bug I filed back when CFSpreadsheet was in beta before the release of CF8 (785,511 bug reports ago), that the header row should not be included in the resulting data. At the time the answer I got from the engineering team was that it was "functioning as designed." But if there's anything I think we should have learned from (the late) Adam Cameron, it would be not to take crappy responses like that lying down. So I think it's time to put the spotlight back on that one.

I found it in the bug database (3039531) but it's marked as "withdrawn" as a duplicate of ... something. The bug number of the supposed original is provided, but it's not found. I'm going to try to draw attention to this existing bug instead of submitting a new one.

Update: Rupesh was kind enough to point out, on that older bug, that an attribute named "excludeHeaderRow" was added to resolve this second bug. I seem to recall hearing about this before, now that it's mentioned, but I obviously had long forgotten it. So at least that one's resolved.

Please vote accordingly, if you agree.

Published 2014-09-16 @ 08:20 in ColdFusion

HQL Keywords

I was recently bitten by the fact that apparently "Member" is a reserved keyword in Hibernate's HQL. I was further disgusted to find that, apparently, no canonical list of HQL keywords exists. All we have to go on is references to individual keywords in the documentation ("after the keyword...") and complaints of people that have accidentally run into them.

I'm not the first to run into this issue and hope to raise awareness by blogging about it, but I have been known to read that blog from time to time and this still bit me, so I figured it was worth reverberating it a bit.

As far as I can find, all of the words on this list are reserved keywords, either as reported by someone that ran into an issue using one as a table/entity name, or by references to them as keywords in the documentation.

  • Member
  • Event
  • Class
  • State
  • Extends ("when using the extends keyword")
  • From ("the FROM keyword is optional")
  • Versioned ("adding the VERSIONED keyword")
  • Update ("after the UPDATE keyword")
  • As ("the AS keyword is optional")
  • With ("the hql WITH keyword")
  • Join ("the JOIN keyword")
  • Distinct ("the DISTINCT keyword")
  • All ("the ALL keyword")
  • True
  • False ("the keywords TRUE and FALSE")
  • Connect ("the CONNECT keyword")

Presumably, additional SQL-ish words like SELECT, WHERE, GROUP, ORDER, LIKE, etc are also reserved (or at least troublesome). I would avoid any of the above for Entity/Table names, if I were you.

In my case, I had a table and entity named Member, which is a pretty logical thing to do when you're modeling an organization with Members.

Since my system has been running fine with an entity named Member for a while now, and it would be a real pain to go back and change everything, I tried to find the easiest possible solution. Here's what I changed:

  • Renamed Member.cfc (entity) to xMember.cfc
  • Updated entity relationships from cfc="Member" to cfc="xMember"
  • Updated any HQL references from from Memberto from xMember
  • Updated any EntityLoad("Member") references to EntityLoad("xMember")

So far, so good.

Published 2014-09-08 @ 08:30 in ColdFusion Hibernate