java.lang.ClassNotFoundException:org.bouncycastle.asn1.ASN1Encodable [英] java.lang.ClassNotFoundException: org.bouncycastle.asn1.ASN1Encodable

查看:4287
本文介绍了java.lang.ClassNotFoundException:org.bouncycastle.asn1.ASN1Encodable的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在使用IText 4.2.0和bcprov-jdk15-1.43.jar以及bctsp-jdk15-1.43.jar来签署pdf。我通过在Eclipse中添加外部jar按钮添加了这些jar。当我执行它时会给我以下错误。

I am using IText 4.2.0 and bcprov-jdk15-1.43.jar and bctsp-jdk15-1.43.jar for signing pdf. I added these jars by add external jars button in Eclipse. When I execute it gives me following error.

ExceptionConverter: java.lang.Exception: Failed to get TSA response from tsaURL
at com.lowagie.text.pdf.TSAClientBouncyCastle.getTimeStampToken(TSAClientBouncyCastle.java:185)
at com.lowagie.text.pdf.TSAClientBouncyCastle.getTimeStampToken(TSAClientBouncyCastle.java:136)
at com.lowagie.text.pdf.PdfPKCS7.getEncodedPKCS7(PdfPKCS7.java:1236)
at pack1.PDFSigningWithHSM.PDFSigningWithHSM.main(PDFSigningWithHSM.java:489)

Caused by: java.lang.NoClassDefFoundError: org/bouncycastle/asn1/ASN1Encodable
at com.lowagie.text.pdf.TSAClientBouncyCastle.getTimeStampToken(TSAClientBouncyCastle.java:146)
... 3 more

Caused by: java.lang.ClassNotFoundException: org.bouncycastle.asn1.ASN1Encodable
at java.net.URLClassLoader$1.run(Unknown Source)
at java.net.URLClassLoader$1.run(Unknown Source)
at java.security.AccessController.doPrivileged(Native Method)
at java.net.URLClassLoader.findClass(Unknown Source)
at java.lang.ClassLoader.loadClass(Unknown Source)
at java.lang.ClassLoader.loadClass(Unknown Source)
... 4 more

但是我在jar文件bcprov-jdk15-1.43.jar中看到了类ASN1Encodable。我不明白是什么问题。

But I see Class ASN1Encodable in the jar file bcprov-jdk15-1.43.jar. I dont understand what is the problem.

推荐答案

该异常意味着类加载器在运行时无法找到该类。我们没有足够的信息来确定原因是什么......但这肯定是导致问题的原因。

That exception means that the classloader cannot find that class at runtime. We don't have enough information to determine why it is the case ... but it is definitely the cause of your problems.

检查有问题的JAR文件是否真的存在在应用程序的有效运行时类路径上。

Check that the offending JAR file is actually on your application's effective runtime classpath.

这篇关于java.lang.ClassNotFoundException:org.bouncycastle.asn1.ASN1Encodable的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
相关文章
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆