Thursday, February 3, 2011

no such method? you must be joking java.lang.NoSuchMethodError

In our project we use Spring Security's new release and we didn't care about the versions of different Spring components like Spring Beans, Core etc and probably left few old versions next to new versions. The result is a nice exception and I had to figure out why.

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

After a little bit of googling I saw that the root cause is the fact that we use old versions in some Spring components next to new ones. I removed the old ones from pom.xml and everything's fixed.