启动报错关键信息如下:
Caused by: java.lang.IllegalStateException: Unable to complete the scan for annotations for web application [] 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.ASN1Boolean->org.bouncycastle.asn1.DERBoolean->org.bouncycastle.asn1.ASN1Boolean]
原因:
程序中出现了循环依赖的类,tomcat扫描jar包时候,递归调用太深,导致栈溢出
解决办法:
在tomcat的conf/ catalina.properties文件中排除对上述jar包的扫描,即:在conf/ catalina.properties文件中tomcat.util.scan.StandardJarScanFilter.jarsToSkip末尾增加:
bcpkix-*.jar,bcprov-*.jar,fr-*.jar