-
Mar 17th, 2008, 10:34 AM
#1
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/Object
Ljava/lang/String;
java.lang.NoSuchMethodError: org.springframework.util.ObjectUtils.identityToStr ing(Ljava/lang/Object
Ljava/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?
-
Mar 17th, 2008, 12:30 PM
#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.
-
Mar 17th, 2008, 02:00 PM
#3
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
-
Forum Rules