I\'m getting a NoSuchMethodError
error when running my Java program. What\'s wrong and how do I fix it?
In my case I had a multi module project and scenario was like com.xyz.TestClass
was in module A
and as well as in module B
and module A
was dependent on module B
. So while creating a assembly jar I think only one version of class was retained if that doesn't have the invoked method then I was getting NoSuchMethodError
runtime exception, but compilation was fine.
Related : https://reflectoring.io/nosuchmethod/