異常問題:Caused by: java.lang.IllegalStateException: Unable to complete the scan for annotations for web application [XXX] 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.ASN1EncodableVe
ctor]
問題根因:因為tomcat啟動會去掃描jar包,看錯誤信息org.bouncycastle.asn1.ASN1EncodableVector是出在這個類,這個類似出現在bcprov*.jar這個包。
解決方法:找到tomcat --> conf中的catalina.properties文件,在tomcat.util.scan.DefaultJarScanner.jarsToSkip=里面加上bcprov*.jar過濾,重啟就不會報錯了。
ps:百度搜索到其他解決方案有:升級tomcat。(這個沒親測過,不知行不行)