Announcement Announcement Module
No announcement yet.
Strange NoSuchMethod error Page Title Module
Move Remove Collapse
Conversation Detail Module
  • Filter
  • Time
  • Show
Clear All
new posts

  • Strange NoSuchMethod error

    Hi all,

    I've inherited a Spring project from a previous developer and am trying to deploy it for testing. He has it set up in Maven. When I do "mvn jetty:run-exploded", I get this:

    INFO: Initializing Spring root WebApplicationContext
    ERROR|2008-03-17 11:30:38,813|ContextLoader.initWebApplicationConte xt(203)|Context initialization failed
    org.springframework.beans.BeanInstantiationExcepti on: Could not instantiate bean class [ icationContext]: Constructor threw exception; nested exception is java.lang.NoSuchMethodError: org.springframework.util.ObjectUtils.identityToStr ing(Ljava/lang/ObjectLjava/lang/String;
    java.lang.NoSuchMethodError: org.springframework.util.ObjectUtils.identityToStr ing(Ljava/lang/ObjectLjava/lang/String;
    at ationContext.<init>(AbstractApplicationContext.jav a:143)
    at ationContext.<init>(AbstractApplicationContext.jav a:177)
    at hableApplicationContext.<init>(AbstractRefreshable
    at freshableWebApplicationContext.<init>(AbstractRefr
    at icationContext.<init>(XmlWebApplicationContext.jav a:62)

    ......several more

    I've found exactly one instance of this same error on Google, and there was no fix posted there. Anybody have a clue what could be going wrong?

  • #2
    Different version of Spring in the classpath. Make sure that there is exactly one, not 2. Also if you use the spring.jar make sure there are no spring-*.jar files on your web app.

    Also check the classpath/lib directories for another spring version lurking around.


    • #3
      Awesome, thank you so much. Turns out that it was a case of having "spring-2.0.6.jar" instead of "spring.jar".