Alfred’s Computing Weblog

Alfred Java-cored Computing Weblog

Spring | NoSuchMethodError: GenericTypeResolver

with 4 comments

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.

Advertisements

Written by Alfred

June 20, 2011 at 18:02

4 Responses

Subscribe to comments with RSS.

  1. 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

  2. Thanks. Same problem. Resolved quickly.

    Sri

    December 4, 2013 at 6:31

  3. Really helped. Thanks so much

    Uchenna

    April 28, 2014 at 16:51


Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

%d bloggers like this: