The Problem
You have a working Spring Security 2.0.x setup and want to upgrade to the latest as of the time of this writing version 3.0.x. You did a (re)search on the Internet and found basically nothing. You are puzzled.
The Solution
You are not gonna like it but you have to get your hands dirty, figuratively speaking, and make it happen the hard way.
- Remove the old libraries and drop in the new ones. You gotta get a lot of red in your IDE.
- Make the red go away. The 3.x distro contains a file named class_mapping_from_2.0.x.txt. It can save you a search or two.
- Update your Spring Security config files so that the schemaLocation ends with spring-security-3.0.xsd. If you have a validating XML editor you'll get a fair amount of red wavy lines right away.
- Make the red go away. Refer to Security Namespace Configuration section of the manual.
- If you happen to use an IDE that understands Java code in JSP pages, such as MyEclipse, hunt for the red there and exterminate it. Otherwise proceed to the next step.
- Deploy your application. It'll blow up. That's OK. Have a look at the log. There was a lot of shuffling of the properties (defaultTargetUrl etc) among various classes between versions 2 and 3. Move the offending properties in your SS config file as needed.
- Your application should now deploy fine. Run it and see if it bombs. It it is it may be because you didn't do a good job at step 5. Now you should have a good indication of where to look at. Have a look and resolve.
- If you made it this far you are done. Congratulations!
Now when I'm done with the upgrade I keep asking myself the same question. How comes the supposedly best-of-breed enterprise-class software breaks backward compatibility in such an intricate, outrageous, in-your-face way?
Understandably Spring Security is the only game in town for the security-heavy shops on the EJB-less enterprise bandwagon. This is a classic vendor lock-in scenario in its uglier manifestation. A (re)design decision made by a few talanted developers is going to reverberate in the enterprise for years.
The enterprise is obsessed with compatibility and continuity. How can I recommend Spring Security to my next enterprise client with a straight face?