Tomcat 7 “SEVERE: A child container failed during start”

后端 未结 18 1692
别跟我提以往
别跟我提以往 2020-11-27 03:42

Basically, I\'ve written a springMVC application (with a relatively shotgun my way first-timer approach with regards to Spring). The project works fine on Tomc

相关标签:
18条回答
  • 2020-11-27 04:21

    I recently moved to a new PC all my eclipse projects. I experienced this issue. What i did was:

    1. removed the project from tomcat
    2. clean tomcat
    3. run project in tomcat
    0 讨论(0)
  • 2020-11-27 04:22

    This same issue occurred for me and stack trace

    SEVERE: A child container failed during start
    java.util.concurrent.ExecutionException: org.apache.catalina.LifecycleException: Failed to start component [StandardEngine[Tomcat].StandardHost[localhost].StandardContext[/XXXXSearch]]
        at java.util.concurrent.FutureTask.report(FutureTask.java:122)
        at java.util.concurrent.FutureTask.get(FutureTask.java:192)
        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.run(FutureTask.java:266)
        at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142)
        at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617)
        at java.lang.Thread.run(Thread.java:745)
    Caused by: org.apache.catalina.LifecycleException: Failed to start component [StandardEngine[Tomcat].StandardHost[localhost].StandardContext[/XXXXSearch]]
        at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:154)
        ... 6 more
    Caused by: java.lang.IllegalStateException: Unable to complete the scan for annotations for web application [/XXXXSearch]. Possible root causes include a too low setting for -Xss and illegal cyclic inheritance dependencies
        at org.apache.catalina.startup.ContextConfig.processAnnotationsStream(ContextConfig.java:2109)
        at org.apache.catalina.startup.ContextConfig.processAnnotationsJar(ContextConfig.java:1981)
        at org.apache.catalina.startup.ContextConfig.processAnnotationsUrl(ContextConfig.java:1947)
        at org.apache.catalina.startup.ContextConfig.processAnnotations(ContextConfig.java:1932)
        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)
        at org.apache.catalina.core.StandardContext.startInternal(StandardContext.java:5179)
        at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:150)
        ... 6 more
    Caused by: java.lang.StackOverflowError
        at org.apache.catalina.startup.ContextConfig.populateSCIsForCacheEntry(ContextConfig.java:2269)
        at org.apache.catalina.startup.ContextConfig.populateSCIsForCacheEntry(ContextConfig.java:2269)
        at org.apache.catalina.startup.ContextConfig.populateSCIsForCacheEntry(ContextConfig.java:2269)
        at org.apache.catalina.startup.ContextConfig.populateSCIsForCacheEntry(ContextConfig.java:2269)
        at org.apache.catalina.startup.ContextConfig.populateSCIsForCacheEntry(ContextConfig.java:2269)
        at org.apache.catalina.startup.ContextConfig.populateSCIsForCacheEntry(ContextConfig.java:2269)
        at org.apache.catalina.startup.ContextConfig.populateSCIsForCacheEntry(ContextConfig.java:2269
        at org.apache.catalina.startup.ContextConfig.populateSCIsForCacheEntry(ContextConfig.java:2269)
        at org.apache.catalina.startup.ContextConfig.populateSCIsForCacheEntry(ContextConfig.java:2269)
        at org.apache.catalina.startup.ContextConfig.populateSCIsForCacheEntry(ContextConfig.java:2269)
        at org.apache.catalina.startup.ContextConfig.populateSCIsForCacheEntry(ContextConfig.java:2269)
        at org.apache.catalina.startup.ContextConfig.populateSCIsForCacheEntry(ContextConfig.java:2269)
    

    In my analysis what i found was, this issue is occurred when illegal cyclic inheritance dependencies caused for Tomcat startup annotation processing.

    But my project had lot of dependency JARs, and couldn't found which one is responsible for this.

    After trying so many unhappy approaches What i did was , I have updated my tomcat plugin to following and ran the same scenario,

    <plugin>
        <groupId>org.apache.tomcat.maven</groupId>
        <artifactId>tomcat8-maven-plugin</artifactId>
        <version>3.0-r1756463</version>
    <\plugin>
    

    Then i was able to find which JAR is caused to this issue ,

    Aug 23, 2017 2:32:12 PM org.apache.catalina.startup.ContextConfig processAnnotationsJar
    SEVERE: Unable to process Jar entry [cryptix/test/TestLOKI91.class] from Jar [jar:file:/C:/Users/Tharinda/.m2/repository/cryptix/cryptix/1.2.2/cryptix-1.2.2.jar!/] for annotations
    java.io.EOFException
        at org.apache.tomcat.util.bcel.classfile.FastDataInputStream.readUnsignedShort(FastDataInputStream.java:120)
        at org.apache.tomcat.util.bcel.classfile.ClassParser.readAttributes(ClassParser.java:110)
        at org.apache.tomcat.util.bcel.classfile.ClassParser.parse(ClassParser.java:94)
        at org.apache.catalina.startup.ContextConfig.processAnnotationsStream(ContextConfig.java:1994)
        at org.apache.catalina.startup.ContextConfig.processAnnotationsJar(ContextConfig.java:1944)
        at org.apache.catalina.startup.ContextConfig.processAnnotationsUrl(ContextConfig.java:1919)
        at org.apache.catalina.startup.ContextConfig.processAnnotations(ContextConfig.java:1880)
        at org.apache.catalina.startup.ContextConfig.webConfig(ContextConfig.java:1149)
        at org.apache.catalina.startup.ContextConfig.configureStart(ContextConfig.java:771)
        at org.apache.catalina.startup.ContextConfig.lifecycleEvent(ContextConfig.java:305)
        at org.apache.catalina.util.LifecycleSupport.fireLifecycleEvent(LifecycleSupport.java:117)
        at org.apache.catalina.util.LifecycleBase.fireLifecycleEvent(LifecycleBase.java:90)
        at org.apache.catalina.core.StandardContext.startInternal(StandardContext.java:5120)
        at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:150)
        at org.apache.catalina.core.ContainerBase$StartChild.call(ContainerBase.java:1408)
        at org.apache.catalina.core.ContainerBase$StartChild.call(ContainerBase.java:1398)
        at java.util.concurrent.FutureTask.run(FutureTask.java:266)
        at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142)
        at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617)
        at java.lang.Thread.run(Thread.java:745)
    

    Then just solving the issue with cryptix-1.2.2.jar solved this problem.

    I strongly recommend to move tomcat8-maven-plugin which seems stable and less buggy at the moment.

    0 讨论(0)
  • 2020-11-27 04:24

    I have seen this exception while tomcat started and it almost took many hours to figure out the reason. Finally I found out that there were some Spring JARs of a lower version in the lib folder in addition to the Spring jars in the Maven dependencies. The JARs in the lib were automatically added by Eclipse when I added a new Spring Rest controller. I removed those from the lib folder and then let Maven handle the JARs/dependancies and it was fine. Bottom line is if the JARS managed by maven and jars in the WEB-INF/lib causes a classpath issues, you may encounter this error.

    0 讨论(0)
  • 2020-11-27 04:27

    This is usually the problem with web.xml descriptor file. May be you have mixed up the annotations and web.xml servlet description definitions. Please check the console for more information.

    0 讨论(0)
  • 2020-11-27 04:30

    This seems like that the servlet api version which you using is older than the xsd you are using in web.xml eg 3.0

    use this one ****http://java.sun.com/xml/ns/javaee/" id="WebApp_ID" version="2.5"> ****

    0 讨论(0)
  • 2020-11-27 04:34

    I have same problem but in my case By mistake I added a context in server.xml ($Tomcat_Install_Dir/conf/) and doesn't deployed corresponing war in webapps($Tomcat_Install_Dir/webapps). As I removed that context and restarted tomcat it working fine.

    0 讨论(0)
提交回复
热议问题