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

  • 相关阅读:
    uva624 CD (01背包+路径的输出)
    算法:全排列
    Android使用Intent实现拨打电话的动作
    Java并发编程从入门到精通 张振华.Jack --我的书
    《算法导论》— Chapter 12 二叉查找树
    Java中arraylist和linkedlist源代码分析与性能比較
    Cg入门14:Vertex Shader
    Nucleus PLUS的启动、执行线程和中断处理
    Unity Shaders and Effects Cookbook (3-5) 金属软高光
    EasyDarwin开发出相似于美拍、秒拍的短视频拍摄SDK:EasyVideoRecorder
  • 原文地址:https://www.cnblogs.com/miaoying/p/9475916.html
Copyright © 2011-2022 走看看