pulsar 2.6.0 bouncy-castle-bc-shaded 包跟 bcpkix-jdk 版本冲突 .BouncyCastleProvider
<dependency>
<groupId>org.springframework.cloud</groupId>
<artifactId>spring-cloud-starter-hystrix</artifactId>
<exclusions>
<exclusion>
<groupId>org.bouncycastle</groupId>
<artifactId>bcpkix-jdk15on</artifactId>
</exclusion>
</exclusions>
</dependency>
<dependency>
<groupId>com.dominos.common</groupId>
<artifactId>dominos-mq</artifactId>
<version>0.0.1-SNAPSHOT</version>
<exclusions>
<exclusion>
<groupId>org.apache.pulsar</groupId>
<artifactId>bouncy-castle-bc-shaded</artifactId>
</exclusion>
</exclusions>
</dependency>
import org.bouncycastle.jce.provider.BouncyCastleProvider;
冲突类
AES/CBC/PKCS7Padding
代码:
Cipher cipher = null;
cipher = Cipher.getInstance("AES/CBC/PKCS7Padding");
异常:
Cannot find any provider supporting AES/CBC/PKCS7Padding java.security.NoSuchAlgorithmException:
Cannot find any provider supporting AES/CBC/PKCS7Padding at javax.crypto.Cipher.getInstance(Cipher.java:540)
解决:排除无用包
来源:oschina
链接:https://my.oschina.net/xiaominmin/blog/4448044