一个jar包冲突引起的StackOverflowError
項目啟動錯誤信息: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>
總結
以上是生活随笔為你收集整理的一个jar包冲突引起的StackOverflowError的全部內容,希望文章能夠幫你解決所遇到的問題。
- 上一篇: 【Linux】常见命令总结
- 下一篇: 理解和使用工具(二)-文件系统Heira