Month: January 2012

Here’s how to solve America’s developer shortage – JavaWorld

I want to write more about this article when I get a chance. Having recently been back on the job market I have some opinions about this. I don’t think there is a shortage of IT workers. Rather, I think there is a shortage of GOOD ones.

Here’s how to solve America’s developer shortage – JavaWorld.

Inner vs. Outer Join

Here is a really good visual explanation of different types of SQL joins. I was recently asked what the difference was, and while I knew the answer, I fumbled to articulate it. I should have simply said “An inner joint results in a subset or overlap of results and an outer join results in a union of results from two or more tables.” (i.e., outer joins return records for the left side even if nothing exists for the right side.)

[Coding Horror: A Visual Explanation of SQL Joins]

Apache Commons Configuration with JBoss 5

Here’s a problem that frustrated me for a bit: When using Apache Commons Configuration under JBoss 5, I kept running into the following error when attempting to save to my configuration file (which was a resource under the deployed /classes path):

ERROR [org.apache.catalina.core.ContainerBase.[jboss.web].[localhost].[/xxxx].[xxxx]] (http- Servlet.service() for servlet flint threw exception protocol doesn't support output

What the heck? This error happened every time I attempted to save to my configuration file. It worked fine in Tomcat 6.x, but any time I tested on JBoss, while I could read from the configuration file, the above error was thrown every time I attempted to write to it.

JBoss 5.x VFS (virtual file abstraction) for the files that it deploys, and this causes problems with Commons Config’s default FileChangedReloadingStrategy. So the fix is to do something like this instead:

VFSFileChangedReloadingStrategy f = VFSFileChangedReloadingStrategy();
((FileConfiguration) config).setReloadingStrategy(f);

It turns out that we really want to use VFSFileChangedReloadingStrategy (which means using Apache Commons Config 1.7) . This also requires that the Apache Commons VFS API be on your classpath. The good news is that VFSFileChangedReloadingStrategy works well even with non-VFS deployments (i.e. plain old Tomcat and Jetty). Problem solved!