解决java.lang.IncompatibleClassChangeError

在做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是没有的。

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

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值