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.