启动时报创建bean错误,国密2(sm2)无法创建bean.
Unsatisfied dependency expressed through constructor parameter 4; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'initSm2' defined in class path resource [com/framework/config/Sm2Config.class]: Bean instantiation via factory method failed; nested exception is org.springframework.beans.BeanInstantiationException: Failed to instantiate [cn.hutool.crypto.asymmetric.SM2]: Factory method 'initSm2' threw exception; nested exception is java.lang.NoClassDefFoundError: org/bouncycastle/crypto/signers/StandardDSAEncoding
其他服务的都能启动,就这个不行,后面发现这个服务的pom文件里有极光依赖,把极光依赖排除后就可以正常启动了。一个很奇怪的bug。
<exclusion> <artifactId>jiguang-common</artifactId> <groupId>cn.jpush.api</groupId> </exclusion> <exclusion> <artifactId>jpush-client</artifactId> <groupId>cn.jpush.api</groupId> </exclusion>