BlueDragon Live!

Well, I'm happy to say that I just deployed my first BlueDragon app to production this evening. It's not much (couple hundred KB), but it's up and running on BD 6.2 Beta. I discovered a whole slew of bugs as I put it together (it was a ~5 day sprint of late nights), but nothing really stood squarely in the way.

The app in question is the backend for this blog (along with The Boisvert Life, for the personal side of me). For various reasons, I'm still using Movable Type as the engine, but I needed an admin interface that I could manipulate, so I rolled my own. Now that it's functional, I can extend it in various ways, which was the whole point of the exercise.

As part of the update, I also installed MySQL 4.1, upgraded the MySQL connector, and a few other things, so I should be golden for a while. This largely meatless post, as you've not doubt guessed, was the maiden post from the new interface, and all seems to have gone well.

Reorganization

I got to thinking last night that I didn't have the categories of the blog broken down very well. The "ColdFusion" category in particular was quite broad. So I broke it down into three categories, and reassigned the existing entries as needed:

  • BlueDragon: entries about New Atlanta's BlueDragon CFML runtime
  • CFML: entries about the CFML language in general
  • Fusebox: entries about the Fusebox framework, and it's supporting topics.

I'm also thinking about making some more feeds of a non-global nature. Not sure if it would be better if they were category-specific, or for groups of categories. Please share your thoughts about what you'd like to see, since, after all, a blog's readership is the only purpose for it's existance, and it should meet their needs.

Will It Never End?

So, BD 6.1 Beta solved most of my problems with CFCs. I'm on cloud nine, and I'm finally getting some work done. It's not perfect, but none of the other bugs were really more than inconveniences (for instance, it gets grumpy when you mix full CFC paths with pathless references to CFCs in the same package). No big deal, just figure out what the issue is, and work around it (always full-path everything, in this case). Plugging away, and I've got the backend of my app finally put together.

Now it's time for the front end. Throw the Fusebox 4.1 skeleton app in there and run it. Error about indexing 'attributes' as an array, trying to set the default fuseaction. Refresh. No issue. WTF? Refresh, fine. Refresh, fine. Touch the code, refresh, error. An hour later I've isolated the problem. Scope leak on a CFLOOP tag iterating over a query.

We all love the fact that CFML lets you reference the fields of the current record of a recordset you're looping over with just the column name. Once you stop the loop, that stops functioning, and you have to again fully scope the field you want (queryname.columnname[row]). BD was doing that, but if you raised an exception inside the loop, it never bothered to turn off that special psuedo-scope. Which meant that for the remainder of your request, variables in the VARIABLES scope that happen to have the same name as a column in the query you were iterating over are shadowed, just as they were inside the CFLOOP.

And of course, 'attributes', that wonderfully versatile, utterly indispensible Fusebox scope is the problem in this case. The loader runs a CFDIRECTORY tag and loops the result, potentially throwing an exception. And guess what, there's a column called "attributes" on queries returned from CFDIRECTORY, so any time it throws that exception, the request fails. (As an aside, the exception in question is an internal exception that the core files use for their internal functioning. It never sees the light of day, except in the CFMX debugging output, if you have the exception list turned on.)

Fortunately, that exception will never be raised in production environments, it's part of a development-mode-only feature (the conditional loader), so no apps are going to break. But it makes development rather difficult, as you might imagine.

Version Control Rules

I was a non-believer in version control for a while. Then about two and a half years ago I took over a decent sized project (around 70,000 LOC) and knew I'd be in trouble without something to help me keep track of it all. So I started using CVS.

Nothing but good things to say. Yeah, CVS has some shortcomings (many of which are addressed in SubVersion), but version control in general is something no one should be without. It does the obvious things, of course, like letting you go back and look at any past version of a file. However, what I find really valuable is some of the codebase management stuff.

For example, say you've got a live version of your site, and you're working on a big update. However, you realize that there's a bug (or the client wants something tweaked) on the current site, and it can't wait until the new version. So you go fix it on the live site. The next step is to replicate the change in the new version. Not a big deal if it's adding an "s" to a word that wasn't pluralized, but if it's a bigger change spanning multiple files, it's a lot harder. However, if you've got your project in version control, it's a snap. You just merge the changes from the live branch to the development branch, and BAM! you're done.

A simpler case. Say you work on your workstation at the office, but you also do some work on the road with a laptop. Every time you switch computers, you need to make sure you have the most recent codebase in the right places. That can mean lots of file copies, and chances are good, some accidental overwrites. If you're using version control, you just check out the code onto both machines, and when you switch, hit "update", and you magically have the most recent version from the repository without any accidental overwrites, and any places where you might have had an overwrite occur is nicely marked for you to deal with.

Anyway, if you're not using some sort of version control, I'd highly recommend starting. I won't lie to you, there is a bit of a learning curve, but six months from now, you'll be thanking yourself for that little bit of pain and suffering, becuase your life will be so much easier.

User Error!!!

So my problem from last night where CFCs wouldn't work on the URL turned out to be a conflict between CFMX and BlueDragon. I don't have CFMX installed on my box any more, but when I uninstalled it, it left a couple Axis config files in a WEB-INF directory. BD, being the well-behaved J2EE application that it is, was trying to use them, rather than it's own, because it assumed they were placed there intentionally to override it's internal ones. Just a simple matter of deleting those files and problem gone. Yay!

I do have to give NewAtlanta props for being on the ball getting issues like this resolved. One of their engineers figured out exactly what the problem was for me, with no input from me except a copy of the error message (and that routed through a couple other people), and within a matter of hours, I had a description of the problem, how it happened, and how to solve it. This is the shining example, but for pretty much every problem I've had, I've gotten a personal response back with either help to resolve it, or at least confirmation that it's a bug, and that it's now known and will be fixed.

BlueDragon Update (a nice one!)

After getting blasted by the NewAtlanta folks in private (which I don't deny I deserved), I thought I should add some more context for my previous posts about BlueDragon.

First, I'm using BD 6.2 Beta, so bugs are to be expected, and in that sense, I don't really have any grounds for complaining when things don't work. In theory they will, but beta is beta, and it's not perfect by definition.

Second, I undoubtedly appear pretty quick to blast BD for being a "poor" CFML implementation. That's far from the case. NewAtlanta has done a fantastic job with providing an alternate CFML runtime. I'm attempting to wring every last drop of functionality out of the edge functionality CFML provides, and that means I'm constantly living on the "edge cases", where the differences between CFMX and BD are going to be most apparent. Couple that with a beta product, and there's no real reason not to expect as many problems as I've had.

Third, I'm a CFMX user for my day job, and BD is not CFMX (duh). When I get home from the office, I've been in CFMX-world all day, and assume BD ought to function the same way. That's about 95% valid, I'd say, and the last 5% are things that aren't really part of CFML, and are therefore subject to vendor-specific differences. Then there is also the lag that BD necessarily has over the CFMX. Since there isn't a spec to implement, NewAtlanta can only start working on features when Macromedia releases a version of CFMX. So it's to be expected that features which are stable, but relatively new, in CFMX will probably be buggy in BD.

Bottom line, I'm still using BD for my personal development. If the product was really so pathetic, I wouldn't be using it. Yes, it's frustrating a times, and that frustration is reflected in my posts, but in the grand scheme of things, BD's a pretty solid product.

And yes, I am making a attempt to purchase a CFMX license, but that's not necessarily a poor reflection on BD, but rather that using both interchangably isn't something I'm good at. I'd love to not buy CFMX, and instead spend the cash on a Studio MX 2004 upgrade and some random gift for my wife and/or daughter. As things stand right now, I'm probably going to do the latter. The web services bug looks like it should be resolvable without an inordinate amount of effort, and CFMX will return to "not even remotely worth the cost" status.

Anyway, my ranting and raving isn't as bad as it sounds. The day I stop posting about BD is the day that I gave up, so as long as I'm writing about it, rest assured that I see value in using it over other CFML runtimes.

The Dragon is at it Again

I was just about to come say how happy I am with BlueDragon 6.2 in comparison to how I was two weeks ago. I've had great success working with my framework and getting it moving along nicely. But, then I started on the frontend of a project I've been working on separately, and ran into another show stopper. The UI is [going to be] built using Rob Rohan's Neuromancer, and consequently need to make some web service calls to my facade CFCs. Unfortunately, BD doesn't want to do that, it just throws a big nasty Axis fault for both ?wsdl requests and for the "my.cfc?method=myMethod" means of calling CFCs for "normal" page handling.

So here I am, once again smashed up against the almost functional BlueDragon. I suppose I should just assume that nothing works, and test every bit of functionality before planning to use it, but that seems like such a back-assward approach. Oh well.

Where's The Boisvert Life??

If you came to 'www.barneyb.com' looking for The Boisvert Life, it's been moved to it's own domain: 'www.theboisvertlife.com'. I usually go to great lengths to ensure that I don't change URLs on people, but in this case, my hand was forced by some internal changes I had to make. Apologies for any inconvenience; this should be the last time it changes.

More BlueDragon Fun

I've been continuing to work with BD 6.2 beta, and having pretty good success. There have been a pretty substantial number of bumps along the way, but none of them have been show stoppers, and it is a beta offering, so it's not supposed to be perfect. All in all, things are going well.

Then I went to upgrade my server (the one running this site). Oof. Tried uninstalling 6.1. Failure. Tried reinstalling 6.1. Failure. Tried deleting all the 6.1 crap (including that pesky /usr/local/NewAtlanta/.registry file) and reinstalling 6.1. Failure. Tried downloading the 6.2 beta from New Atlanta's web site. Error because they have some weird HTTPS -> HTTP transition that lynx and w3m can't deal with. Tried their FTP server. Not accepting connections. Tried downloading it to my laptop, and then uploading it to my server. Corrupted archive. Try downloading it on my linux box at home to upload. Won't go past ~6MB. Try again. Same result. Try to start a session on my powerbook and hijack it with lynx after the HTTPS -> HTTP transition. Denied. Try the FTP server again, and it thankfully lets me in. No ls command though. Finally figure out I have to switch from passive to active FTP and I can do 'ls'. Download the beast.

45MB later…. Delete all my 6.1 stuff from the several installs (backing up my config, of course). Run the 6.2 installer. Like a champ. None of my sites work though. Cycle BD and Apache. Still nothing. Run a ps auwx | grep java on there, and to my surprise, I've got 5 independant BD processes running!! Manually kill everything, restarting BD, and viola!

So now that they've got the CFC bugs worked out, definitely time to spend a little effort on the start/stop scripts and the install/uninstall procedure. Fortunately that's stuff that I don't use much, so it won't really bother me if they don't.

BlueDragon Update

Well, after a couple days of using the BlueDragon 6.2 beta, I haven't found any major problems with it. There have been a few little bugs, but nothing show stopping yet. As well as the CFC location issues that were driving me nuts, they fixed the issue with calling overloaded Java methods.

In 6.1, you simply couldn't call overloaded methods if the only difference between the methods was the type of the parameters, and one type was a subclass of another type. An example is the format method of the java.text.SimpleDateFormat class. It has both format(java.lang.Object) and format(java.util.Date) varieties, and since Date is a subclass of Object, BD refused to differentiate between them and threw an error if you tried to call the method. JavaCast is of no help here, because it only deals with primative types. CFMX has always used the "closest" type, so if you pass a CF date, it will assume you want the Date version. Fortunately that's fixed in the 6.2 beta, which opens up a whole world of possibilities for using Java classes.