1.报错:
<dependency><groupId>com.cybersource</groupId><artifactId>cybersource-sdk-java</artifactId><version>6.2.11</version></dependency>
在引入 cybersource的 依赖后,调用其api访问cybersource时报错:
error constructing MAC: java.lang.SecurityException: JCE cannot authenticate the provider BC
2.其他参考:
尝试了:
a.无政策限制权限文件Unlimited Strength Jurisdiction Policy Files
b.添加security.provider.x=org.bouncycastle.jce.provider.BouncyCastleProvider;加jar包依赖,bcprov-jdk15-135.jar 和bcprov-jdk16-143.jar 。
均未解决问题;
链接: https://stackoverflow.com/questions/13721579/jce-cannot-authenticate-the-provider-bc-in-java-swing-application.
3.最终解决方法:
根据官方说明:
链接: https://www.oracle.com/java/technologies/javase/17-relnote-issues.html.
最终通过将jdk更换成open jdk 解决此问题;