Results 1 to 3 of 3

Thread: Strange NoSuchMethod error

  1. #1
    Join Date
    Mar 2008
    Posts
    2

    Default 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 [org.springframework.web.context.support.XmlWebAppl 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 org.springframework.context.support.AbstractApplic ationContext.<init>(AbstractApplicationContext.jav a:143)
    at org.springframework.context.support.AbstractApplic ationContext.<init>(AbstractApplicationContext.jav a:177)
    at org.springframework.context.support.AbstractRefres hableApplicationContext.<init>(AbstractRefreshable ApplicationContext.java:72)
    at org.springframework.web.context.support.AbstractRe freshableWebApplicationContext.<init>(AbstractRefr eshableWebApplicationContext.java:99)
    at org.springframework.web.context.support.XmlWebAppl 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. #2
    Join Date
    Jun 2006
    Location
    The Netherlands
    Posts
    13,624

    Default

    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.
    Marten Deinum
    Java Consultant / Pragmatist / Open Source Enthousiast / Author


    Pro Spring MVC: With Web Flow
    Conspect

    Have you read the reference guide.
    Use the [ code ] tags, young padawan

  3. #3
    Join Date
    Mar 2008
    Posts
    2

    Default

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

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •