3

I am getting below error, I believe its due to OLDER version of spring-beans.jar, In my LIB i have spring-beans--3.1.1.RELEASE.jar but still getting below error. I have deployed my application on WAS 8.5.X server.

java.lang.NoSuchMethodError: org/springframework/beans/MutablePropertyValues.add(Ljava/lang/String;Ljava/lang/Object;)Lorg/springframework/beans/MutablePropertyValues;

Is there any way to search on linux to find the culprit jar?

1 Answer 1

3

You can check what jar file that class is loaded from, adding the line below to your Java program

System.out.println(System.class.getResource(
           "/org/springframework/beans/MutablePropertyValues.class"));

which should print something like

jar:file:/C:/my-program/lib/spring-beans-5.2.1.RELEASE.jar!/org/springframework/beans/MutablePropertyValues.class

or using Guava's Resources.getResource("org/springframework/beans/MutablePropertyValues.class");


NoSuchMethodError error usually means there is a mismatch between the version of that class and the version expected by its clients. It could eventually be the case that the spring-beans jar version is actually correct- if that is the case, it is worth checking the version of the code invoking it, too.

Sign up to request clarification or add additional context in comments.

2 Comments

For WebSphere traditional, if you want to avoid app recompilation/redeployment, I'd suggest enabling the "Verbose class loading" option in the administrative console, on the JVM configuration panel, which adds -verbose:class to the Java invocation. It will print out the source of every class load by the JVM to native_stderr.log, which you can search for the classes in question.
Or manually copy a JSP out to the installed directory, with scriptlet running the same kind of code. I was using a WebSphere-specific mechanism here, but I'll have to see if this generic one works just as well: dougbreaux.github.io/2010/07/29/…

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.