问题:java lang NoSuchFieldError:ecdsa_with_SHA224

遇到问题:

root cause

java.lang.NoClassDefFoundError: Could not initialize class org.bouncycastle.cms.CMSSignedDataGenerator
    com.lsy.baselib.crypto.protocol.PKCS7Signature.sign(PKCS7Signature.java:62)
    com.lsy.baselib.crypto.processor.ECCryptoProcessor.sign(ECCryptoProcessor.java:165)

root cause

java.lang.NoSuchFieldError: ecdsa_with_SHA224
    org.bouncycastle.cms.CMSSignedGenerator.<clinit>(Unknown Source)
    com.lsy.baselib.crypto.protocol.PKCS7Signature.sign(PKCS7Signature.java:62)
    com.lsy.baselib.crypto.processor.ECCryptoProcessor.sign(ECCryptoProcessor.java:165)

解决方案:
两个包起冲突了!!!
其中光大银行提供的bcprov-jdk-1.0.jar与中信银行提供的jce-jdk13-136-1.0.jar是不同版本的里面结构也是大同小异,本来都测好的功能了,出了这茬浪费时间啊!!!!希望可以会帮助到后来的童鞋!

Solution:
This is only going to happen if you’re mixing a later version of the CMS
library with an earlier version of the provider.

ps:同样问题的童鞋

http://bouncy-castle.1462172.n4.nabble.com/NoSuchFieldError-ecdsa-with-SHA224-td2165090.html

0条留言