一个jar包冲突引起的StackOverflowError

来源:互联网 发布:微信三级分销系统源码 编辑:程序博客网 时间:2024/05/17 20:31


项目启动错误信息:java.lang.IllegalStateException: Unable to complete the scan for annotations for web application [/app] due to a StackOverflowError. 

Possible root causes include a too low setting for -Xss and illegal cyclic inheritance dependencies. 

The class hierarchy being processed was [org.bouncycastle.asn1.ASN1EncodableVector->org.bouncycastle.asn1.DEREncodableVector->org.bouncycastle.asn1.ASN1EncodableVector


解决办法:

Run configuration  --> Arguments --> VM arguments -Xss4m

以上方式治标不治本,我的错误信息里面已经提示的比较明显了:cyclic inheritance dependencies

所以,这里靠谱的解决办法应该是:

找到冲突的jar包,Excluded掉其中一个就是了

如何找到冲突的jar包并Excluded掉?

1、打开工程pom文件

2、进入Dependency Hierarhcy视图,右上过滤框中输入bcprov

bcprov-jdk14-1.50.jar 和 bcprov-jdk16-1.46.jar都出现了

3、选择其中一个jar包,右键Excluded Maven Artifact,。。。



最后在pom中效果如下:

<dependency>
       <groupId>test.message</groupId>
<artifactId>test.message.api</artifactId>
<exclusions>
<exclusion>
<artifactId>bcprov-jdk14</artifactId>
<groupId>org.bouncycastle</groupId>
</exclusion>
</exclusions>
</dependency>



0 0
原创粉丝点击