Java “Losing its Mojo?” I Think Not!

Wired has an article titled Is Java Losing Its Mojo? While the article seems to contradict itself in some ways, I have to take issue with the general theme. As someone who pays attention, I simply haven’t seen this happening. On the contrary–It seems to me that Java continues to grow. Just peruse the job boards. Continue reading

Everything about Java 8 – TechEmpower Blog

Everything about Java 8 – TechEmpower Blog

Java 8/Lambas

lambdaZeroTurnaround has a post about lamba expressions in Java 8 with some examples. Really cool. That last time I even really heard of a lambda expression was in college while briefly learning Lisp. Lambda expressions can be tried out now for anyone wishing to take a look. I’ll be trying it out when I have a free moment. I know this is old news to many software geeks…

C Overtakes Java in 2012

Interesting. I was surprised to see man of the entries on the list, especially MATLAB.

Java to Objective C Translator

Google Open Sources Java To Objective-C Translator [i-programmer.info]

The Diamond Problem

The Diamond Problem

“Fun” with multiple inheritance:
Multiple inheritance – Wikipedia, the free encyclopedia
Programmer Interview: What is the diamond problem? Does it exist in Java? (nope)

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-0.0.0.0-8080-1) Servlet.service() for servlet flint threw exception
java.net.UnknownServiceException: protocol doesn't support output
at java.net.URLConnection.getOutputStream(URLConnection.java:792)
at org.apache.commons.configuration.AbstractFileConfiguration.save
(AbstractFileConfiguration.java:449)

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!