Tag Archives: spring

Spring Annotations, Spring MVC and an interesting bug in 2.5.1

I’ve been doing some work in Spring MVC (Spring v2.5.1) and using annotations to see how simple I can keep my XML configuration (pretty small so far) and while coming across a few interesting gotchas that I’ll be describing in another entry I come across this most maddening problem. If you have a Spring MVC controller defined and it even has an inner class in it, the Spring loader will not find it. It basically ignores it. I had been using inner classes for form beans and validators on some of my controllers and it would just not work. By pulling them out into their own classes, however, everything worked.  That was pretty annoying to say the least.

Here’s the bug: http://jira.springframework.org/browse/SPR-4324

And it is fixed in 2.5.2. So if you’re using annotations in Spring, just go ahead and upgrade. It will save you lots of pain.

The other thing, mind your base packages on annotation scans. I’ll be posting that experience in the next day or so. I’m still slapping my head over that on.

Spring 2.5 Released

It looks like Spring 2.5 was released today. I’ve already been using the annotations for both service definition and web controller definition to greatly reduce the size of my configuration files. These are a great addition and I’m sure that I’ll be exploring them a lot in the future.

The other area that grabbed my interest was new integration test classes that support TestNG since previously they didn’t really seem to support TestNG with their test framework.