现象

启动程序报错,同时在classpath下有多个bcprov-jdk开头的包

Caused by: java.util.jar.JarException: file:/C:/Users/93986/.gradle/caches/modules-2/files-2.1/org.bouncycastle/bcprov-jdk18on/1.78/619aafb92dc0b4c6cc4cf86c487ca48ee2d67a8e/bcprov-jdk18on-1.78.jar is not signed by a trusted signer.
        at javax.crypto.JarVerifier.verifySingleJar(JarVerifier.java:502) ~[?:1.8.0_71]
        at javax.crypto.JarVerifier.verifyJars(JarVerifier.java:322) ~[?:1.8.0_71]
        at javax.crypto.JarVerifier.verify(JarVerifier.java:250) ~[?:1.8.0_71]
        at javax.crypto.JceSecurity.verifyProviderJar(JceSecurity.java:160) ~[?:1.8.0_71]
        at javax.crypto.JceSecurity.getVerificationResult(JceSecurity.java:186) ~[?:1.8.0_71]
        at javax.crypto.Cipher.getInstance(Cipher.java:653) ~[?:1.8.0_71]
        at javax.crypto.Cipher.getInstance(Cipher.java:596) ~[?:1.8.0_71]

解决

通过maven或gradle排除掉不需要的包即可。

Logo

魔乐社区(Modelers.cn) 是一个中立、公益的人工智能社区,提供人工智能工具、模型、数据的托管、展示与应用协同服务,为人工智能开发及爱好者搭建开放的学习交流平台。社区通过理事会方式运作,由全产业链共同建设、共同运营、共同享有,推动国产AI生态繁荣发展。

更多推荐