Thursday, December 31, 2009

Migrating to Spring Security 3.0

I recently upgraded my web application (a side project that I am working on at home) to use Spring 3.0 and Spring Security 3.0.

Moving to Spring 3.0 was pretty seamless - drop in the new jars (don't forget aopalliance.jar) and you are good to go. My project works the same now as it did before, and now I can start using some of the new features!

The migration to Spring Security 3.0 took an hour or two work through.

Here are some of the small issues that I ran into: (these only take minutes to fix)

  1. Make sure you change your XSD references to reference the new 3.0 schema.
  2. There was some package refactoring, so several of my classes had to have import references fixed.
  3. <security:anonymous/> is really no longer needed.
  4. The getAuthorities method on the UserDetails interface now returns a Collection (rather than an array).
  5. Make sure to include spring-security-config.jar


The only other issue that really bit me was an XML validation issue. I was using a customer authentication provider in my XML file that looked like this:


<security:authentication-provider ref="userDetailsService">


This was giving me the following validation error:

cvc-complex-type.2.4.c: The matching wildcard is strict, but no declaration can be found for element 'security:authentication-provider'.


Luckily, someone else ran across the same issue, and I fixed it by wrapping my authentication-provider inside an authentication-manager:


<security:authentication-manager alias="authenticationManager">
<security:authentication-provider ref="userDetailsService"/>
</security:authentication-manager>

Saturday, December 26, 2009

Crappy Graphics, Lots of Fun.

So, I actually played with an XBox 360 the other day. I had some time to kill while Jenn was at church, and she gave me some errands to run. Before running the errands, I decided to drop by Best Buy and get some hands-on time with some digital cameras. The digital camera selection at Best Buy quickly bored me, so I decided to play with an XBox 360 (since there was no one using the demo kiosk).

I walked up to the kiosk, and fumbled my way through a driving game. The graphics were great (but on par with modern computers). The force feedback was good, and I was having fun playing the game... for about 5 minutes. After five minutes, I realized that I was using a little thumb nob to move a car around a race track.

I was completely amazed at how much I missed playing Mario Kart. Sure the graphics are about 10 years old. Sure the game does not have the uber-realistic physics system that allowed me to dent up the car.

But Mario Card has a controller that lets me play a game with a real steering wheel.

I walked away from a top-of-the-line gaming system, thinking "Meh".

Oh yeah.. Played Mario Kart again. It was a blast.