Announcement Announcement Module
Collapse
No announcement yet.
Strange NoSuchMethod error Page Title Module
Move Remove Collapse
X
Conversation Detail Module
Collapse
  • 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 [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
    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.

    Comment


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

      Comment

      Working...
      X