More Organs → More Human

Stupid things I've figured out so that you don't have to.


Site Feed

Tuesday, February 28, 2006

Throwing Down the Gauntlet

Right, I know, two posts in two days... kind of different that the usual MO around here. But I felt the need to declare before the world that I have officially HAD IT with Tomcat. I have just spent the last two hours of my life— hours that should have been spent doing something, ANYTHING, other than dealing with Tomcat— screwing around with JNDI contexts, obscure classpaths, xml configuration files, and so on, trying to figure out why an application that had worked perfectly well on one laptop wouldn't work on another. The answer is annoyingly nitpickingly technical, so go ahead and ignore the next paragraph if you want.

It had to do with the fact that the application had been written a laptop which, for all sorts of stupid reasons, still has Tomcat 5.0 on it. My newer laptop is much more up to date, and has a relatively current version of Tomcat 5.5 on it. Even though these are only a few minor versions off, they have wildly different configuration file formats, and this is what finally bit me in the ass. See, in pre-5.5-Tomcat, a JNDI resource declaration consisted of a Resource tag and then a ResourceParam tag containing the configuration parameters for your resource. 5.5 does away with this, and now parameters are declared as attributes for the top-level Resource. This change is definitely for the better, and I can see why they made it— it simplifies a confusing and overly complex configuration process.

The problem is that if you try and use the old behavior, it fails silently, and then causes your code to break in odd ways. Rather than give an error message, or support the old behavior with a deprecation warning, Tomcat just forges boldly on ahead. Anything that was trying to use those parameters now gets null, which causes all sorts of interesting runtime errors. Would it have killed them to put ten lines of code in to check to see if you were still trying to use ResourceParam tags, and then spit out a warning to stderr? Why do they hate their users so much? Why?

This change in configuration file format is, in fact, documented... but it's pretty well hidden, as is so much of what one usually looks for in Tomcat's documentation. Gah.

At any rate, I have now officially Had Enough With Tomcat. No more screwing around with massive XML configuration files— it's over. Oh wow, that felt good to say. Not sure what I'll be using now... I've really been digging Ruby on Rails, and the 1.1 release will finally add polymorphic relationships and easy support for aggregate functions (count(), sum(), etc.) and group-by statements to ActiveRecord. This news makes me happy... perhaps it's time to see if they've made any progress with easing the pain of hosting a RoR app.

0 Comments:

Post a Comment

<< Home