How do I fix a NoSuchMethodError?

前端 未结 29 2839
孤独总比滥情好
孤独总比滥情好 2020-11-21 05:08

I\'m getting a NoSuchMethodError error when running my Java program. What\'s wrong and how do I fix it?

29条回答
  •  执笔经年
    2020-11-21 05:48

    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/

提交回复
热议问题