Easy Event-Driven Application With Spring!

Suppose you are making an event-driven application. You have your listener interfaces and your event-generating objects. What is the most annoying part of getting this all to work?

Connecting your listeners to the event-generating objects. Every time you want some object to receive certain events, you have to register your listener with the correct producer object. This has some nasty effects on your code:

  • Either your listeners know to which object they are subscribing, or your event generators know who should be listening to their events
  • Due to this coupling, listeners and producers are difficult to test
  • Adding a new listener to your project requires some boilerplate code to get it working

Spring has a feature that can take care of all of this hassle: autowiring. For normal dependency injection, autowiring feels icky. It’s just too magical and leaves me with a feeling I am not in control. The great thing about autowiring is that it can be used on a per-method base.

Continue reading

Eclipse Galileo and NTLMv2 Proxies

While configuring the newest installment of Eclipse, Eclipse 3.5 (Galileo), I ran into some proxy trouble. After setting the proxy-configuration, the ‘Install New Software…’ window would structurally say ‘No repository found on <location>’.

After some Googling and researching, it appears to be a problem with Eclipse’s underlying URL/Proxy handling library. This library is now Apache httpclient, which does not support NTLMv2 proxies. Luckily, there’s a workaround.

If you are behind an NTLMv2 proxy, you can force Eclipse to revert its URL/Proxy handling library to the old JRE URLConnection by adding these lines to your eclipse.ini file:


If your proxy does not require authentication, you can leave out the proxyUser and proxyPassword settings.

For more information, see http://wiki.eclipse.org/ECF_Filetransfer_Support_for_NTLMv2_Proxies.


Connecting JBoss instances through JNDI

So here I was, cleanly splitting out the service EJB and web front of an application. We even went so far as to have the two components run in separate JBoss instances, on separate machines. But… they had to communicate to each other through a JNDI lookup. That’s where we ran into a ditch, fought with Java and JBoss settings for a few days and came out victorious. Let me help you stay out of these trenches and show how to configure this.

Continue reading

Configure JBoss WS on a multiple network interfaces

The JBoss WebServices package is a nice library to get your webservice kickstarted in no-time. One of its features is the automatic generation of a WSDL for your webservice endpoint. There is however a slight annoyance when you try to use this on a machine with two network interfaces.

On a single interface machine, JBoss automatically fills in the IP address or hostname of that interface in the <soap:address/> WSDL entry. No problems there. But, if you have a machine with two interfaces, for example one for internal and one for external access, then JBoss is likely to screw things up.

This is due to the following configuration directive in the jbossas/server/production/deploy/jbossws.sar/jbossws.beans/META-INF/jboss-beans.xml:

<property name="webServiceHost">${jboss.bind.address}</property>

This property causes JBoss to use the bind address in the WSDL rewriting/generation. Even if you start the server with -b, which binds it to all interfaces, JBoss still selects a single interface to use in this property.

The solution to this is luckily very simple: if this property is removed from the configuration file, JBoss will rewrite the WSDL with the address of the interface on which the request came in.

It does make me wonder, why is this not the default setting? Would it not be easier to drop in a server anywhere and it automatically exposes correct WSDL files on all interfaces? Then, if you want to restrict it to a single interface, add the property shown above.

SpringSource Application Platform – My Holy Grail

The SpringSource Application Platform has been in beta for some time now. In my rare free time I have been playing with it’s amazing set of features. Now that the platform is nearing its final release I want to share some of my thoughts about it.

I have been a fan of modular design even before I switched to my first Object Oriented Language. Although languages like Visual Basic, C++ and Java provide you with the means of building modular software, none ever enforce it. No matter how strict I design modules in my application, they somehow always get tangled up in each other.

Continue reading

Shameless Devoxx Promotion

On December 8th-12th, this year’s Devoxx (previously JavaPolis) conference takes place in Metropolis, Antwerp. I have been to the conference last year and enjoyed the huge offer of Java talks. I would like to recommend this conference to any Java-enthousiast!


I am currently reading ‘Refactoring: Improving the Design of Existing Code’ by Martin Fowler and one of his tips made me smile:

Any fool can write code that a computer can understand. Good programmers write code that humans can understand.

It made me smile because it is spot-on when it comes to clean and maintainable code. If only you, the author, understand the code, you’ve done something wrong! Use a clear coding style, meaningful method/type/variable names and document EVERYTHING.

My Free Flex Training

Today I cashed in the free training I won from Adobe. In april I visited the J-Spring conference in the Netherlands and as usual dropped my businesscard in any box that had some description with the word ‘win’ in it. Although I had never won anything with this before, this year I won two Flex training sessions.

So here I am, sitting in a nice room at Prisma-IT, working on some nifty Flex application. The course is lead by Mark van Hedel, an Adobe Certified Instructor at Prisma-IT and he is giving us a Jumpstart to Adobe Flex 3.

And a jumpstart is exactly what it is. The course started with a very quick overview of the history of Flex. How we’ve come from mainframes, to client-server applications, to web-applications, to rich internet applications. Subsequently, Mark showed us the basic setup of any Flex application and let us dive into the labs.

I have seen and heard a lot of things here today that I have ran into while hacking around in Flex without guidance. Today’s training has really helped me understand Flex better. I wholeheartedly recommend the course to anyone who is currently working with some object oriented language and wants to get his hands dirty trying out the frikkin best framework for Rich Internet Applications.

I’ll share some of the handy URLs that Mark shared with us: