tomcat启动报异常(一)

  异常问题: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。(这个没亲测过,不知行不行)

原文地址:https://www.cnblogs.com/Jin1000x/p/10881827.html