解决java.lang.IncompatibleClassChangeError

来源:互联网 发布:量子计算与人工智能 编辑:程序博客网 时间:2024/05/22 05:33

在做pdf签章的时候遇到了异常:
Caused by: java.lang.IncompatibleClassChangeError: class org.bouncycastle.asn1.DERObject has interface org.bouncycastle.asn1.ASN1Encodable as super class

百度:
参考:https://yq.aliyun.com/articles/40382

异常的意思很明白,就是说DERObject 以ASN1Encodable 接口作为了超类,继承关系
接口是不能继承的

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):1.Non-final field become static,2.Non-constant field become non-static,3.Class become interface,4.Interface become class,5.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).

快捷键ctrl+shift+t打开open type
这里写图片描述

发现ASN1Encodable 确实有个接口类型
打开对应文件位置
这里写图片描述

不知什么时候手动添加的一个jar包
正常下载的jdk是没有的。

自己挖的坑,跪着也要填完

阅读全文
0 0
原创粉丝点击