由于循环依赖,Tomcat容器无法启动

时间:2014-12-30 08:30:10

标签: java tomcat catalina

我在启动tomcat时遇到错误。由于循环依赖性,tomcat容器无法启动并在日志中显示StackOverflowError。我尝试将-Xss值设置为4M,但它没有帮助。无法确定哪个是给出依赖性问题的确切jar。我使用的是tomcat 7.0.40。

有人可以为此提供帮助。

Dec 29, 2014 2:26:19 PM org.apache.catalina.core.ContainerBase startInternal
SEVERE: A child container failed during start
java.util.concurrent.ExecutionException: org.apache.catalina.LifecycleException: Failed to start component [StandardEngine[Catalina].StandardHost[localhost].StandardContext[/aricloud]]
    at java.util.concurrent.FutureTask$Sync.innerGet(FutureTask.java:222)
    at java.util.concurrent.FutureTask.get(FutureTask.java:83)
    at org.apache.catalina.core.ContainerBase.startInternal(ContainerBase.java:1123)
    at org.apache.catalina.core.StandardHost.startInternal(StandardHost.java:800)
    at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:150)
    at org.apache.catalina.core.ContainerBase$StartChild.call(ContainerBase.java:1559)
    at org.apache.catalina.core.ContainerBase$StartChild.call(ContainerBase.java:1549)
    at java.util.concurrent.FutureTask$Sync.innerRun(FutureTask.java:303)
    at java.util.concurrent.FutureTask.run(FutureTask.java:138)
    at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:895)
    at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:918)
    at java.lang.Thread.run(Thread.java:662)
Caused by: org.apache.catalina.LifecycleException: Failed to start component [StandardEngine[Catalina].StandardHost[localhost].StandardContext[/aricloud]]
    at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:154)
    ... 7 more
Caused by: java.lang.IllegalStateException: Unable to complete the scan for annotations for web application [/aricloud] 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.ASN1EncodableVector]
    at org.apache.catalina.startup.ContextConfig.checkHandlesTypes(ContextConfig.java:2179)
    at org.apache.catalina.startup.ContextConfig.processAnnotationsStream(ContextConfig.java:2126)
    at org.apache.catalina.startup.ContextConfig.processAnnotationsJar(ContextConfig.java:2001)
    at org.apache.catalina.startup.ContextConfig.processAnnotationsUrl(ContextConfig.java:1967)
    at org.apache.catalina.startup.ContextConfig.processAnnotations(ContextConfig.java:1952)
    at org.apache.catalina.startup.ContextConfig.webConfig(ContextConfig.java:1326)
    at org.apache.catalina.startup.ContextConfig.configureStart(ContextConfig.java:878)
    at org.apache.catalina.startup.ContextConfig.lifecycleEvent(ContextConfig.java:369)
    at org.apache.catalina.util.LifecycleSupport.fireLifecycleEvent(LifecycleSupport.java:119)
    at org.apache.catalina.util.LifecycleBase.fireLifecycleEvent(LifecycleBase.java:90)

1 个答案:

答案 0 :(得分:1)

可能在应用程序中添加了相同库的两个版本。 就我而言,它是 bcprov-ext-jdk15on-1.69.jar 和 bcprov-jdk16-143.jar。 一旦我删除了 bcprov-jdk16-143.jar,问题就解决了。