I'm guessing that your Java version is Java 8 but Spring version is 3. Is it? If so, use Spring 4.
Alternatively, install Java 7 as your default JRE, and continue with Spring 3.
The error from "org.springframework.asm.ClassReader" is a giveaway that it's something to do with java class file format, and sure enough it looks like asm version in spring 3 can't handle java 8 compiled classes.
In 1st example, a bean is being instantiated using constructor injection. Apparently, for that, spring uses the asm library which can do class file reading/writing.
In 2nd example, there is no constructor injection and so there's no need to do any class file reading.
The deeper question is why spring is using asm at all and not just plain java reflection? The call to "LocalVariableTableParameterNameDiscoverer.getParameterNames" suggests that spring is doing some parameter matching based on parameter names as declared in source code, and the only way to get those parameter names is by reading the .class file directly. I don't think java reflection API can provide parameter names.
The even deeper question is why do parameter matching at all? I have no idea why. I had assumed constructor injection is done purely on the order of the constructor-arg elements. I'm surprised that parameter names are involved in the logic.
Anybody here has a better explanation for parameter matching?