Question

I'm getting a strange error on a colleague's box. CGLib is auto-proxying a service class for spring AOP logging, and at runtime it says 'unresolved compilation error: must override a superclass method" on the fastclass by cglib proxy class.

In the offending class, I'm using @override annotations when I implement an interface, and I know that it's supported in jdk 1.6 but not 1.5. CGLib is auto-proxying that implementation class.

However, it works fine on my box with jdk_1.6_17, but not on his with jdk_1.6_10.

However however, he can compile the project correctly using maven, which uses the same jdk. Removing the @Override annotation fixes the runtime cglib error, but that's weird right?

What compiler does cglib use for its auto-proxying, and could this be a bug in jdk_1.6_10 or is there something else I'm missing?

Using spring 3.0.4, jboss 5.10, spring security 3.0.3

basically, the class implements AuthenticationUserDetailsService in spring-security.

The offending method signature:

@Override
public UserDetails loadUserDetails(Authentication auth) throws UsernameNotFoundException;

UserDetails is a spring-security interface, and so is Authentication.

Was it helpful?

Solution

Ok, figured it out. I had explicity brought in cglib 2.2 into the pom.xml, and spring-flex was bringing in 2.1_03, which is from 2005. For some reason, my box ended up using the new one, and my colleague's ended up using the old.

Anyone know why a particular one gets loaded first?

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top