Spring | NoSuchMethodError: GenericTypeResolver
ERROR: java.lang.NoSuchMethodError: org.springframework.core.GenericTypeResolver.resolveTypeArguments(Ljava/lang/Class;Ljava/lang/Class;)[Ljava/lang/Class;
STORY:
I am starting a new webapps recently, since its a new webapps, I decided to use the latest Spring version 3.1.0.M2. Everything looks fine when the development is still in standalone environment. After dive into the development, the webapps I’m working on need to ‘talk’ to some other existing components in the system. After I have integrated my webapps with the existing components and I restart my tomcat, I get the error java.lang.NoSuchMethodError: org.springframework.core.GenericTypeResolver.resolveTypeArguments(Ljava/lang/Class;Ljava/lang/Class;)[Ljava/lang/Class;
First of all, for Java developer, when you see ‘NoSuchMethodError’, you will directly check the existence of the mentioned method in your JAR file. But ‘sadly’ the mentioned class file and method is there.
SOLUTION:
Thanks to Google, I got my answer in Spring Forum. The answer is pretty simple, I have more than 1 version of Spring in the classpath. As mentioned earlier, the new webapps is running on latest Spring (v3.1.0.M2) but the existing components I integrates with only running on Spring v2.5. So, pls ensure that there is only ONE SPRING VERSION in your classpath.
Thanks! Same problem here and quickly solved thanks to your post! 😉
martin
April 24, 2012 at 2:29
Thank you so much!
GIG
November 23, 2012 at 11:22
Thanks. Same problem. Resolved quickly.
Sri
December 4, 2013 at 6:31
Really helped. Thanks so much
Uchenna
April 28, 2014 at 16:51