zoukankan      html  css  js  c++  java
  • Tomcat启动报错:Possible root causes include a too low setting for -Xss and illegal cyclic inheritance dependencies

    错误代码如下:

    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]
        at org.apache.catalina.startup.ContextConfig.checkHandlesTypes(ContextConfig.java:2139)
        at org.apache.catalina.startup.ContextConfig.processAnnotationsStream(ContextConfig.java:2083)
        at org.apache.catalina.startup.ContextConfig.processAnnotationsJar(ContextConfig.java:2029)
        at org.apache.catalina.startup.ContextConfig.processAnnotationsUrl(ContextConfig.java:1999)
        at org.apache.catalina.startup.ContextConfig.processAnnotations(ContextConfig.java:1952)
        at org.apache.catalina.startup.ContextConfig.webConfig(ContextConfig.java:1156)
        at org.apache.catalina.startup.ContextConfig.configureStart(ContextConfig.java:765)
        at org.apache.catalina.startup.ContextConfig.lifecycleEvent(ContextConfig.java:299)
        at org.apache.catalina.util.LifecycleBase.fireLifecycleEvent(LifecycleBase.java:123)
        at org.apache.catalina.core.StandardContext.startInternal(StandardContext.java:4989)
        at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:183)
        ... 42 more

    网上给的答案都是调整Xss参数,其实不是正确的做法,

    -Xss:每个线程的Stack大小,“-Xss 15120” 这使得tomcat每增加一个线程(thread)就会立即消耗15M内存,而最佳值应该是128K,默认值好像是512k. 

    具体报错如下

    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.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过滤

    启动不会报错了

    或者升级tomcat版本(绝对解决)

    参考自:https://blog.csdn.net/lb89012784/article/details/50820118

  • 相关阅读:
    【CSDN博客之星评选】我为什么坚持写博客
    关于纯css布局的概况
    IIS服务器下301跳转是怎么样实现的?
    如何使用数据库保存session的方法简介
    PHP如何通过SQL语句将数据写入MySQL数据库呢?
    PHP中文函数顺序排列一数组且其序数不变
    angular实时显示checkbox被选中的元素
    oracle查询正在执行的语句以及正被锁的对象
    angular中ng-repeat去重
    接口自动化测试框架--http请求的get、post方法的实现
  • 原文地址:https://www.cnblogs.com/miaoying/p/9475916.html
Copyright © 2011-2022 走看看