報錯--》due to a StackOverflowError. Possible root causes include a too low setting for -Xss and illega
阿新 • • 發佈:2018-12-14
報錯-->due to a StackOverflowError. Possible root causes include a too low setting for -Xss and illegal cyclic inheritance dependencies
1、詳細資訊
Caused by: java.lang.IllegalStateException: Unable to complete the scan for annotations for web application [/quSuperManager] 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]
2、分析
說ASN1EncodableVector和DEREncodableVector的bcprov jar包下產生了迴圈繼承,所以形成死迴圈,造成記憶體溢位。網上大部分方法是在tomcat配置檔案中加入不掃描這個包的策略。
然而我通過idea全域性搜尋bcprov,發現是引用了兩個不同版本的包引起的。
同時觀察
問題就出在這裡一個繼承一個沒有繼承吧。具體問麼產生的想不出來,問題應該就是這裡。
可以總結出版本不同可能產生這個問題,不同jar包依賴同一jar包也可能產生問題。問題歸根是jar版本衝突。
3、解決
版本出現問題,要麼排除,要麼改成同一版本,這裡是直接就匯入的,顯然直接改版本來得快。
最後改為高版本的,因為一般高版本都會相容一下低版本。自此問題解決。