What causes java.lang.IncompatibleClassChangeError?
2017-05-23 11:55
363 查看
https://stackoverflow.com/questions/1980452/what-causes-java-lang-incompatibleclasschangeerror
80
down vote
80
down vote
Your newly packaged library is not backward binary compatible (BC) with old version. For this reason some of the library clients that are not recompiled may throw the exception. This is a complete list of changes in Java library API that may cause clients built with an old version of the library to throw java.lang.IncompatibleClassChangeError if they run on a new one (i.e. breaking BC): Non-final field become static, Non-constant field become non-static, Class become interface, Interface become class, if you add a new field to class/interface (or add new super-class/super-interface) then a static field from a super-interface of a client class C may hide an added field (with the same name) inherited from the super-class of C (very rare case). Note: There are many other exceptions caused by other incompatible changes: NoSuchFieldError, NoSuchMethodError, IllegalAccessError, InstantiationError, VerifyError, NoClassDefFoundError and AbstractMethodError. The better paper about BC is "Evolving Java-based APIs 2: Achieving API Binary Compatibility" written by Jim des Rivières. There are also some automatic tools to detect such changes: japi-compliance-checker clirr japitools sigtest japi-checker Usage of japi-compliance-checker for your library: japi-compliance-checker OLD.jar NEW.jar Usage of clirr tool: java -jar clirr-core-0.6-uber.jar -o OLD.jar -n NEW.jar Good luck! |
相关文章推荐
- java.lang.IncompatibleClassChangeError: class net.sf.cglib.core.DebuggingClassWriter has interface o
- 异常:Error: java.lang.IncompatibleClassChangeError: Implementing class
- java.lang.IncompatibleClassChangeError: Found class jline.Terminal, but interface was expected
- java.lang.IncompatibleClassChangeError:Implementing class
- java.lang.IncompatibleClassChangeError
- java.lang.IncompatibleClassChangeError: class org.springframework.scheduling.quartz.SimpleTriggerBea
- java.lang.IncompatibleClassChangeError这是什么错误呀,拜托啦
- Exception in thread "main" java.lang.IncompatibleClassChangeError: Found class jline.Terminal, but i
- java.lang.IncompatibleClassChangeError: Implementi
- POI操作Excel出错:java.lang.IncompatibleClassChangeError
- java.lang.IncompatibleClassChangeError错误的解决
- [show] java.lang.IncompatibleClassChangeError:Implementing class
- 异常:Error: java.lang.IncompatibleClassChangeError: Implementing class
- java.lang.IncompatibleClassChangeError: Implementing class
- 异常:java.lang.IncompatibleClassChangeError: Implementing class
- java.lang.IncompatibleClassChangeError
- HIVE Exception in thread "main" java.lang.IncompatibleClassChangeError: Found class jline.Terminal,
- Hibernate3.5却报异常 java.lang.IncompatibleClassChangeError: class org.hibernate.cfg.ExtendedMappings has interface
- An error has occurred. See error log for more details. java.lang.IncompatibleClassChangeError
- Hibernate3.5却报异常 java.lang.IncompatibleClassChangeError: class org.hibernate.cfg.ExtendedMappings ha