Issue
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?
Solution
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.
Answered By - Daniele
Answer Checked By - Mary Flores (JavaFixing Volunteer)