美文网首页
Tomcat stackoverflow

Tomcat stackoverflow

作者: linceln | 来源:发表于2021-07-13 13:30 被阅读0次

非 root 用户跑 tomcat 时遇到报错:

Caused by: java.lang.IllegalStateException: 由于StackOverflower错误,无法完成对web应用程序[]的批注的扫描。可能的根本原因包括-Xss的设置过低和非法的循环继承依赖项。正在处理的类层次结构是[org.bouncycastle.asn1.ASN1OutputStream->org.bouncycastle.asn1.DEROutputStream->org.bouncycastle.asn1.ASN1OutputStream]
                at org.apache.catalina.startup.ContextConfig.checkHandlesTypes(ContextConfig.java:2404)
                at org.apache.catalina.startup.ContextConfig.processAnnotationsStream(ContextConfig.java:2342)
                at org.apache.catalina.startup.ContextConfig.processAnnotationsJar(ContextConfig.java:2294)
                at org.apache.catalina.startup.ContextConfig.processAnnotationsUrl(ContextConfig.java:2264)
                at org.apache.catalina.startup.ContextConfig.scanWebXmlFragment(ContextConfig.java:2172)
                at org.apache.catalina.startup.ContextConfig.processAnnotations(ContextConfig.java:2152)
                at org.apache.catalina.startup.ContextConfig.processClasses(ContextConfig.java:1408)
                at org.apache.catalina.startup.ContextConfig.webConfig(ContextConfig.java:1303)
                at org.apache.catalina.startup.ContextConfig.configureStart(ContextConfig.java:986)
                at org.apache.catalina.startup.ContextConfig.lifecycleEvent(ContextConfig.java:303)
                at org.apache.catalina.util.LifecycleBase.fireLifecycleEvent(LifecycleBase.java:123)
                at org.apache.catalina.core.StandardContext.startInternal(StandardContext.java:5135)
                at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:183)
                ... 38 more

解决办法:
在 tomcat 的 conf/ catalina.properties 文件中排除对上述jar包的扫描,即:在 conf/ catalina.properties 文件中tomcat.util.scan.StandardJarScanFilter.jarsToSkip 末尾增加:

bcpkix-*.jar,bcprov-*.jar,fr-*.jar

如果感觉 tomcat 启动慢,那是因为要扫描jar里的servlet3.0注解,可以在conf/ catalina.properties文件中tomcat.util.scan.StandardJarScanFilter.jarsToSkip末尾增加不需要扫描的jar来提速,如:

spring-amqp-*.jar,\

spring-aop-*.jar,\

spring-aspects-*.jar,\

spring-beans-*.jar,\

相关文章

网友评论

      本文标题:Tomcat stackoverflow

      本文链接:https://www.haomeiwen.com/subject/frcdpltx.html