Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
324 views
in Technique[技术] by (71.8m points)

java - Bouncy castle classes referring to DEREncodable causing NoClassDefFoundError

I'm using iText 7.1.10 and BC Prov 1.64. While verifying the signatures embedded with time-stamp, getting the following errors. One thing that I know about the DEREncodable interface is that it is deprecated in latest versions of the bouncy-castle library which was earlier available in bcprov-jdk15-1.43.jar under the package name org.bouncycastle.asn1.

Now as per the following exception trace itext is doing some initialization and calling the BC classes. I don't know why are the BC classes referring to DEREncodable which is not available in BC prov 1.64?

Caused by: java.lang.NoClassDefFoundError: org/bouncycastle/asn1/DEREncodable
        at org.bouncycastle.tsp.TimeStampToken.getSignedData(Unknown Source)
        at org.bouncycastle.tsp.TimeStampToken.<init>(Unknown Source)
        at com.itextpdf.signatures.PdfPKCS7.<init>(PdfPKCS7.java:447)
        at com.itextpdf.signatures.SignatureUtil.readSignatureData(SignatureUtil.java:216)
    

I've used maven for war creation and deployed the build on the tomcat server where I'm getting this issue. I've only these bouncy castle jars in the tomcat lib directory.

bcmail-jdk15-1.45.jar
bcpkix-jdk15on-1.64.jar
bcprov-jdk15on-1.64.jar

Please find the attached code snippet that triggering the calling to the bouncy castle library enter image description here


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Reply

0 votes
by (71.8m points)
等待大神答复

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
OGeek|极客中国-欢迎来到极客的世界,一个免费开放的程序员编程交流平台!开放,进步,分享!让技术改变生活,让极客改变未来! Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

...