Abstract Method Error

久未见 提交于 2019-11-27 02:05:07

java.lang.AbstractMethodError is thrown when an application tries to call an abstract method. Normally, this error is caught by the compiler; this error can only occur at run time if the definition of some class has incompatibly changed since the currently executing method was last compiled.

Seems like this problem is due to version incompatibility in some of the jar file. I can not figure it from your code. Please check this thread.

This error occurs because an abstract method is called without actual implementation. It usually happens after some library is upgraded while some is not. The dependencies are missing somehow.

Hence please check whether all library upgrades complete successfully.

Here is a good example and demonstration on how an AbstractMethodError can occur.

I had this error from a cause not mentioned here.

I was using proguard and it obfuscated a class, which then led to the AbstractMethodError. Just had to keep that class in proguard.

Zar

This can occur in NetBeans while running Java 8 and implementing an interface using lambdas and then changing the interfaces signature.

Simple solution: run Clean and build (Shift+F11 is by default)*

Put a Breakpoint on the Exception (or the line where it is occurring) to find out which class/method exactly is causing the problem, then search your classpath for all occurrences of this class. If you have more than one version of a class on your classpath, remove the wrong one.

Narendra

I also had the same issue in my case the problem was i have two .class files with same name in two different jar files.I excluded on of the jar file from pom.xml it started working!

I lost some time on this.

In pom.xml, for dependencies if you have set LATEST, it can be due to that, please specify the correct version no there, it is a best practice too

Aspectj version 1.7.3 will solve this issue .Please try it out

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!