如何克服此错误“严重:子容器在启动期间失败”?

时间:2018-12-08 12:55:21

标签: java tomcat servlets server

Dec 08, 2018 6:08:56 PM org.apache.catalina.startup.VersionLoggerListener log
INFO: Server version:        Apache Tomcat/8.5.35
Dec 08, 2018 6:08:56 PM org.apache.catalina.startup.VersionLoggerListener log
INFO: Server built:          Nov 3 2018 17:39:20 UTC
Dec 08, 2018 6:08:56 PM org.apache.catalina.startup.VersionLoggerListener log
INFO: Server number:         8.5.35.0
Dec 08, 2018 6:08:56 PM org.apache.catalina.startup.VersionLoggerListener log
INFO: OS Name:               Windows 10
Dec 08, 2018 6:08:56 PM org.apache.catalina.startup.VersionLoggerListener log
INFO: OS Version:            10.0
Dec 08, 2018 6:08:56 PM org.apache.catalina.startup.VersionLoggerListener log
INFO: Architecture:          amd64
Dec 08, 2018 6:08:56 PM org.apache.catalina.startup.VersionLoggerListener log
INFO: Java Home:             C:\Program Files\Java\jre1.8.0_191
Dec 08, 2018 6:08:56 PM org.apache.catalina.startup.VersionLoggerListener log
INFO: JVM Version:           1.8.0_191-b12
Dec 08, 2018 6:08:56 PM org.apache.catalina.startup.VersionLoggerListener log
INFO: JVM Vendor:            Oracle Corporation
Dec 08, 2018 6:08:56 PM org.apache.catalina.startup.VersionLoggerListener log
INFO: CATALINA_BASE:         C:\Users\DELL\eclipse-workspace\.metadata\.plugins\org.eclipse.wst.server.core\tmp0
Dec 08, 2018 6:08:56 PM org.apache.catalina.startup.VersionLoggerListener log
INFO: CATALINA_HOME:         C:\Program Files (x86)\apache-tomcat-8.5.35
Dec 08, 2018 6:08:56 PM org.apache.catalina.startup.VersionLoggerListener log
INFO: Command line argument: -Dcatalina.base=C:\Users\DELL\eclipse-workspace\.metadata\.plugins\org.eclipse.wst.server.core\tmp0
Dec 08, 2018 6:08:56 PM org.apache.catalina.startup.VersionLoggerListener log
INFO: Command line argument: -Dcatalina.home=C:\Program Files (x86)\apache-tomcat-8.5.35
Dec 08, 2018 6:08:56 PM org.apache.catalina.startup.VersionLoggerListener log
INFO: Command line argument: -Dwtp.deploy=C:\Users\DELL\eclipse-workspace\.metadata\.plugins\org.eclipse.wst.server.core\tmp0\wtpwebapps
Dec 08, 2018 6:08:56 PM org.apache.catalina.startup.VersionLoggerListener log
INFO: Command line argument: -Djava.endorsed.dirs=C:\Program Files (x86)\apache-tomcat-8.5.35\endorsed
Dec 08, 2018 6:08:56 PM org.apache.catalina.startup.VersionLoggerListener log
INFO: Command line argument: -Dfile.encoding=Cp1252
Dec 08, 2018 6:08:56 PM org.apache.catalina.core.AprLifecycleListener lifecycleEvent
INFO: The APR based Apache Tomcat Native library which allows optimal performance in production environments was not found on the java.library.path: [C:\Program Files\Java\jre1.8.0_191\bin;C:\WINDOWS\Sun\Java\bin;C:\WINDOWS\system32;C:\WINDOWS;C:/Program Files/Java/jre1.8.0_191/bin/server;C:/Program Files/Java/jre1.8.0_191/bin;C:/Program Files/Java/jre1.8.0_191/lib/amd64;C:\Program Files (x86)\Intel\Intel(R) Management Engine Components\iCLS\;C:\Program Files\Intel\Intel(R) Management Engine Components\iCLS\;C:\Program Files (x86)\Common Files\Oracle\Java\javapath;C:\WINDOWS\system32;C:\WINDOWS;C:\WINDOWS\System32\Wbem;C:\WINDOWS\System32\WindowsPowerShell\v1.0\;C:\WINDOWS\System32\OpenSSH\;C:\Program Files (x86)\Intel\Intel(R) Management Engine Components\DAL;C:\Program Files\Intel\Intel(R) Management Engine Components\DAL;C:\Program Files (x86)\Intel\Intel(R) Management Engine Components\IPT;C:\Program Files\Intel\Intel(R) Management Engine Components\IPT;C:\Program Files\Intel\WiFi\bin\;C:\Program Files\Common Files\Intel\WirelessCommon\;C:\Users\DELL\AppData\Local\Programs\Python\Python37-32\Scripts\;C:\Users\DELL\AppData\Local\Programs\Python\Python37-32\;C:\Users\DELL\AppData\Local\Microsoft\WindowsApps;;C:\Users\DELL\AppData\Local\Programs\Microsoft VS Code\bin;D:\Microsoft VS Code\bin;C:\Program Files\Intel\WiFi\bin\;C:\Program Files\Common Files\Intel\WirelessCommon\;C:\Users\DELL\Desktop;;.]
Dec 08, 2018 6:08:57 PM org.apache.coyote.AbstractProtocol init
INFO: Initializing ProtocolHandler ["http-nio-8080"]
Dec 08, 2018 6:08:57 PM org.apache.tomcat.util.net.NioSelectorPool getSharedSelector
INFO: Using a shared selector for servlet write/read
Dec 08, 2018 6:08:57 PM org.apache.coyote.AbstractProtocol init
INFO: Initializing ProtocolHandler ["ajp-nio-8009"]
Dec 08, 2018 6:08:57 PM org.apache.tomcat.util.net.NioSelectorPool getSharedSelector
INFO: Using a shared selector for servlet write/read
Dec 08, 2018 6:08:57 PM org.apache.catalina.startup.Catalina load
INFO: Initialization processed in 1614 ms
Dec 08, 2018 6:08:57 PM org.apache.catalina.core.StandardService startInternal
INFO: Starting service [Catalina]
Dec 08, 2018 6:08:57 PM org.apache.catalina.core.StandardEngine startInternal
INFO: Starting Servlet Engine: Apache Tomcat/8.5.35
Dec 08, 2018 6:08:58 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[/intro]]
    at java.util.concurrent.FutureTask.report(Unknown Source)
    at java.util.concurrent.FutureTask.get(Unknown Source)
    at org.apache.catalina.core.ContainerBase.startInternal(ContainerBase.java:942)
    at org.apache.catalina.core.StandardHost.startInternal(StandardHost.java:872)
    at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:150)
    at org.apache.catalina.core.ContainerBase$StartChild.call(ContainerBase.java:1423)
    at org.apache.catalina.core.ContainerBase$StartChild.call(ContainerBase.java:1413)
    at java.util.concurrent.FutureTask.run(Unknown Source)
    at java.util.concurrent.ThreadPoolExecutor.runWorker(Unknown Source)
    at java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown Source)
    at java.lang.Thread.run(Unknown Source)
Caused by: org.apache.catalina.LifecycleException: Failed to start component [StandardEngine[Catalina].StandardHost[localhost].StandardContext[/intro]]
    at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:167)
    ... 6 more
Caused by: java.lang.IllegalArgumentException: The servlets named [listtournament] and [com.view.listtournament] are both mapped to the url-pattern [/listtournament] which is not permitted
    at org.apache.tomcat.util.descriptor.web.WebXml.addServletMappingDecoded(WebXml.java:326)
    at org.apache.tomcat.util.descriptor.web.WebXml.addServletMapping(WebXml.java:319)
    at org.apache.catalina.startup.ContextConfig.processAnnotationWebServlet(ContextConfig.java:2383)
    at org.apache.catalina.startup.ContextConfig.processAnnotationsStream(ContextConfig.java:2060)
    at org.apache.catalina.startup.ContextConfig.processAnnotationsWebResource(ContextConfig.java:1946)
    at org.apache.catalina.startup.ContextConfig.processAnnotationsWebResource(ContextConfig.java:1940)
    at org.apache.catalina.startup.ContextConfig.processAnnotationsWebResource(ContextConfig.java:1940)
    at org.apache.catalina.startup.ContextConfig.webConfig(ContextConfig.java:1147)
    at org.apache.catalina.startup.ContextConfig.configureStart(ContextConfig.java:769)
    at org.apache.catalina.startup.ContextConfig.lifecycleEvent(ContextConfig.java:299)
    at org.apache.catalina.util.LifecycleBase.fireLifecycleEvent(LifecycleBase.java:94)
    at org.apache.catalina.core.StandardContext.startInternal(StandardContext.java:5154)
    at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:150)
    ... 6 more

Dec 08, 2018 6:08:58 PM org.apache.catalina.core.ContainerBase startInternal

//错误在这里
严重:子容器在启动期间失败
    java.util.concurrent.ExecutionException:org.apache.catalina.LifecycleException:无法启动组件[StandardEngine [Catalina] .StandardHost [localhost] .StandardContext [/ firstproject]]         在java.util.concurrent.FutureTask.report(未知来源)         在java.util.concurrent.FutureTask.get(未知来源)         在org.apache.catalina.core.ContainerBase.startInternal(ContainerBase.java:942)         在org.apache.catalina.core.StandardHost.startInternal(StandardHost.java:872)         在org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:150)         在org.apache.catalina.core.ContainerBase $ StartChild.call(ContainerBase.java:1423)         在org.apache.catalina.core.ContainerBase $ StartChild.call(ContainerBase.java:1413)         在java.util.concurrent.FutureTask.run(未知来源)         在java.util.concurrent.ThreadPoolExecutor.runWorker(未知来源)         在java.util.concurrent.ThreadPoolExecutor $ Worker.run(未知来源)         在java.lang.Thread.run(未知来源)     由以下原因引起:org.apache.catalina.LifecycleException:无法启动组件[StandardEngine [Catalina] .StandardHost [localhost] .StandardContext [/ firstproject]]         在org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:167)         ...另外6个     由以下原因引起:java.lang.IllegalArgumentException:名为[listtournament]和[com.view.listtournament]的servlet都映射到url-pattern [/ listtournament],这是不允许的         在org.apache.tomcat.util.descriptor.web.WebXml.addServletMappingDecoded(WebXml.java:326)         在org.apache.tomcat.util.descriptor.web.WebXml.addServletMapping(WebXml.java:319)         在org.apache.catalina.startup.ContextConfig.processAnnotationWebServlet(ContextConfig.java:2383)         在org.apache.catalina.startup.ContextConfig.processAnnotationsStream(ContextConfig.java:2060)         在org.apache.catalina.startup.ContextConfig.processAnnotationsWebResource(ContextConfig.java:1946)         在org.apache.catalina.startup.ContextConfig.processAnnotationsWebResource(ContextConfig.java:1940)         在org.apache.catalina.startup.ContextConfig.processAnnotationsWebResource(ContextConfig.java:1940)         在org.apache.catalina.startup.ContextConfig.webConfig(ContextConfig.java:1147)         在org.apache.catalina.startup.ContextConfig.configureStart(ContextConfig.java:769)         在org.apache.catalina.startup.ContextConfig.lifecycleEvent(ContextConfig.java:299)         在org.apache.catalina.util.LifecycleBase.fireLifecycleEvent(LifecycleBase.java:94)         在org.apache.catalina.core.StandardContext.startInternal(StandardContext.java:5154)         在org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:150)         ...还有6个

Dec 08, 2018 6:08:58 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]]
    at java.util.concurrent.FutureTask.report(Unknown Source)
    at java.util.concurrent.FutureTask.get(Unknown Source)
    at org.apache.catalina.core.ContainerBase.startInternal(ContainerBase.java:942)
    at org.apache.catalina.core.StandardEngine.startInternal(StandardEngine.java:262)
    at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:150)
    at org.apache.catalina.core.StandardService.startInternal(StandardService.java:422)
    at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:150)
    at org.apache.catalina.core.StandardServer.startInternal(StandardServer.java:793)
    at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:150)
    at org.apache.catalina.startup.Catalina.start(Catalina.java:687)
    at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
    at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
    at java.lang.reflect.Method.invoke(Unknown Source)
    at org.apache.catalina.startup.Bootstrap.start(Bootstrap.java:353)
    at org.apache.catalina.startup.Bootstrap.main(Bootstrap.java:493)
Caused by: org.apache.catalina.LifecycleException: Failed to start component [StandardEngine[Catalina].StandardHost[localhost]]
    at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:167)
    at org.apache.catalina.core.ContainerBase$StartChild.call(ContainerBase.java:1423)
    at org.apache.catalina.core.ContainerBase$StartChild.call(ContainerBase.java:1413)
    at java.util.concurrent.FutureTask.run(Unknown Source)
    at java.util.concurrent.ThreadPoolExecutor.runWorker(Unknown Source)
    at java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown Source)
    at java.lang.Thread.run(Unknown Source)
Caused by: org.apache.catalina.LifecycleException: A child container failed during start
    at org.apache.catalina.core.ContainerBase.startInternal(ContainerBase.java:953)
    at org.apache.catalina.core.StandardHost.startInternal(StandardHost.java:872)
    at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:150)
    ... 6 more
Caused by: org.apache.tomcat.util.MultiThrowable: 2 wrapped Throwables: [org.apache.catalina.LifecycleException: Failed to start component [StandardEngine[Catalina].StandardHost[localhost].StandardContext[/intro]]][org.apache.catalina.LifecycleException: Failed to start component [StandardEngine[Catalina].StandardHost[localhost].StandardContext[/firstproject]]]
    at org.apache.catalina.core.ContainerBase.startInternal(ContainerBase.java:946)
    ... 8 more

Dec 08, 2018 6:08:58 PM org.apache.catalina.startup.Catalina start
SEVERE: The required Server component failed to start so Tomcat is unable to start.
org.apache.catalina.LifecycleException: Failed to start component [StandardServer[8005]]
    at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:167)
    at org.apache.catalina.startup.Catalina.start(Catalina.java:687)
    at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
    at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
    at java.lang.reflect.Method.invoke(Unknown Source)
    at org.apache.catalina.startup.Bootstrap.start(Bootstrap.java:353)
    at org.apache.catalina.startup.Bootstrap.main(Bootstrap.java:493)
Caused by: org.apache.catalina.LifecycleException: Failed to start component [StandardService[Catalina]]
    at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:167)
    at org.apache.catalina.core.StandardServer.startInternal(StandardServer.java:793)
    at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:150)
    ... 7 more
Caused by: org.apache.catalina.LifecycleException: Failed to start component [StandardEngine[Catalina]]
    at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:167)
    at org.apache.catalina.core.StandardService.startInternal(StandardService.java:422)
    at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:150)
    ... 9 more
Caused by: org.apache.catalina.LifecycleException: A child container failed during start
    at org.apache.catalina.core.ContainerBase.startInternal(ContainerBase.java:953)
    at org.apache.catalina.core.StandardEngine.startInternal(StandardEngine.java:262)
    at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:150)
    ... 11 more
Caused by: java.util.concurrent.ExecutionException: org.apache.catalina.LifecycleException: Failed to start component [StandardEngine[Catalina].StandardHost[localhost]]
    at java.util.concurrent.FutureTask.report(Unknown Source)
    at java.util.concurrent.FutureTask.get(Unknown Source)
    at org.apache.catalina.core.ContainerBase.startInternal(ContainerBase.java:942)
    ... 13 more
Caused by: org.apache.catalina.LifecycleException: Failed to start component [StandardEngine[Catalina].StandardHost[localhost]]
    at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:167)
    at org.apache.catalina.core.ContainerBase$StartChild.call(ContainerBase.java:1423)
    at org.apache.catalina.core.ContainerBase$StartChild.call(ContainerBase.java:1413)
    at java.util.concurrent.FutureTask.run(Unknown Source)
    at java.util.concurrent.ThreadPoolExecutor.runWorker(Unknown Source)
    at java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown Source)
    at java.lang.Thread.run(Unknown Source)
Caused by: org.apache.catalina.LifecycleException: A child container failed during start
    at org.apache.catalina.core.ContainerBase.startInternal(ContainerBase.java:953)
    at org.apache.catalina.core.StandardHost.startInternal(StandardHost.java:872)
    at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:150)
    ... 6 more
Caused by: org.apache.tomcat.util.MultiThrowable: 2 wrapped Throwables: [org.apache.catalina.LifecycleException: Failed to start component [StandardEngine[Catalina].StandardHost[localhost].StandardContext[/intro]]][org.apache.catalina.LifecycleException: Failed to start component [StandardEngine[Catalina].StandardHost[localhost].StandardContext[/firstproject]]]
    at org.apache.catalina.core.ContainerBase.startInternal(ContainerBase.java:946)
    ... 8 more

Dec 08, 2018 6:08:58 PM org.apache.coyote.AbstractProtocol pause
INFO: Pausing ProtocolHandler ["http-nio-8080"]
Dec 08, 2018 6:08:58 PM org.apache.coyote.AbstractProtocol pause
INFO: Pausing ProtocolHandler ["ajp-nio-8009"]
Dec 08, 2018 6:08:58 PM org.apache.catalina.core.StandardService stopInternal
INFO: Stopping service [Catalina]
Dec 08, 2018 6:08:58 PM org.apache.coyote.AbstractProtocol destroy
INFO: Destroying ProtocolHandler ["http-nio-8080"]
Dec 08, 2018 6:08:58 PM org.apache.coyote.AbstractProtocol destroy
INFO: Destroying ProtocolHandler ["ajp-nio-8009"]

1 个答案:

答案 0 :(得分:0)

从顶部到底部读取堆栈跟踪,然后查看最后的“ Caused by”行。这是问题的原始原因。它说:

Failed to start component [StandardEngine[Catalina].StandardHost[localhost].**StandardContext[/firstproject]**]]

Tomcat客厅中的“ 上下文”是一个Web应用程序。 (它是Tomcat组件体系结构中最低的“容器”,仅次于服务器,服务,引擎和主机。)

因此Tomcat基本上说您的Web应用无法启动。

原因也已给出。其中两个是:

<ServletMapping> contains an invalid <url-pattern>

The servlets named [listtournament] and [com.view.listtournament] are both mapped to the url-pattern [/listtournament] which is not permitted.

<ServletMapping>web.xml文件的元素。因此,要解决此问题,您需要修复web.xml正确设置ServletMappings 。请参阅Servlet规范https://javaee.github.io/servlet-spec/ 3.1版(对于Tomcat 8.5版);它说明了有效的url模式和ServletMappings以及其他所有内容。