Java.lang.NoSuchMethodError: com.Person.setCompanyList(Ljava/util/ArrayList;)V [closed]

StackOverflow https://stackoverflow.com/questions/15544336

  •  29-03-2022
  •  | 
  •  

Question

Can anyone help me why NOSuchMethodError comes in java in run time.my error is .Java.lang.NoSuchMethodError: com.Person.setCompanyList(Ljava/util/ArrayList;)V

Was it helpful?

Solution

This generally means that the version of the library or class you compiled against is not the same version that is being run now.

When you compiled, the method was there (otherwise there would have been a compile error), but now it is not (maybe because the jar file is too old).

Try a clean build and deploy of your whole project.

The other frequent case is reflection, when you have method names constructed at run time (for methods that just do not exist).

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top