Hmmm, I've written a small test myself and ran into the same problem. It seems it's some kind of classloading issue.
To be honest, I'm no classloading expert, so I guess somebody else will have to help out here. There seems to be a difference between the contextclassloader associated with the current thread and the classloader I'm getting from e.g. java.lang.Class. This I knew, but I can't figure out why the first line from the following code passes and the second lines fails! The second line is used in the ResourcePatternResolver (context classloader is used everywhere in Spring IIRC)