org.bouncycastle.jcajce.provider.asymmetry.DSTU4145$Mappings 类的 SecurityException

Sam*_*nta 6 java spring oauth-2.0 spring-boot

我正在使用 Spring boot 版本2.1.11spring-security-oauth2-autoconfigure 。在我的 中添加后pom.xml。运行应用程序时出现以下错误。

 "java.lang.SecurityException: class "org.bouncycastle.jcajce.provider.asymmetric.DSTU4145$Mappings"'s signer information does not match signer information of other classes in the same package"
Run Code Online (Sandbox Code Playgroud)

pas*_*ale 7

这是因为要加载的库中的某些 jar 版本不兼容。罐子地狱。尝试排除该组org.bouncycastle。您还可以指定版本:bcprov-jdk16

对于梯度:

implementation(group: 'aaa', name: 'bbb', version: '1.0.0') {
  exclude group: 'org.bouncycastle'
}
Run Code Online (Sandbox Code Playgroud)

对于行家:

<dependency>
        <groupId>aaa</groupId>
        <artifactId>bbb</artifactId>
        <version>1.0.0</version>
        <exclusions>
            <exclusion>
                <groupId>org.bouncycastle</groupId>
                <artifactId>bcprov-jdk16</artifactId>
            </exclusion>
        </exclusions>
</dependency>
Run Code Online (Sandbox Code Playgroud)