Eclipse Maven項目報錯2之A child container failed during start

問題:在同事那裏拿了一個Eclipse的maven項目,導入報錯,主要顯示的是A child container failed during startjava

具體錯誤以下web

六月 02, 2018 12:08:50 下午 org.apache.tomcat.util.digester.SetPropertiesRule begin
警告: [SetPropertiesRule]{Server/Service/Engine/Host/Context} Setting property 'source' to 'org.eclipse.jst.jee.server:UcomWechat' did not find a matching property.
六月 02, 2018 12:08:50 下午 org.apache.catalina.startup.VersionLoggerListener log
信息: Server version:        Apache Tomcat/9.0.0.M17
六月 02, 2018 12:08:50 下午 org.apache.catalina.startup.VersionLoggerListener log
信息: Server built:          Jan 10 2017 20:59:20 UTC
六月 02, 2018 12:08:50 下午 org.apache.catalina.startup.VersionLoggerListener log
信息: Server number:         9.0.0.0
六月 02, 2018 12:08:50 下午 org.apache.catalina.startup.VersionLoggerListener log
信息: OS Name:               Windows 10
六月 02, 2018 12:08:50 下午 org.apache.catalina.startup.VersionLoggerListener log
信息: OS Version:            10.0
六月 02, 2018 12:08:50 下午 org.apache.catalina.startup.VersionLoggerListener log
信息: Architecture:          amd64
六月 02, 2018 12:08:50 下午 org.apache.catalina.startup.VersionLoggerListener log
信息: Java Home:             D:\Program Files\Java\jdk1.8.0_121\jre
六月 02, 2018 12:08:50 下午 org.apache.catalina.startup.VersionLoggerListener log
信息: JVM Version:           1.8.0_121-b13
六月 02, 2018 12:08:50 下午 org.apache.catalina.startup.VersionLoggerListener log
信息: JVM Vendor:            Oracle Corporation
六月 02, 2018 12:08:50 下午 org.apache.catalina.startup.VersionLoggerListener log
信息: CATALINA_BASE:         D:\workspace\.metadata\.plugins\org.eclipse.wst.server.core\tmp1
六月 02, 2018 12:08:50 下午 org.apache.catalina.startup.VersionLoggerListener log
信息: CATALINA_HOME:         D:\Tomcat 9.0
六月 02, 2018 12:08:50 下午 org.apache.catalina.startup.VersionLoggerListener log
信息: Command line argument: -Dcatalina.base=D:\workspace\.metadata\.plugins\org.eclipse.wst.server.core\tmp1
六月 02, 2018 12:08:50 下午 org.apache.catalina.startup.VersionLoggerListener log
信息: Command line argument: -Dcatalina.home=D:\Tomcat 9.0
六月 02, 2018 12:08:50 下午 org.apache.catalina.startup.VersionLoggerListener log
信息: Command line argument: -Dwtp.deploy=D:\workspace\.metadata\.plugins\org.eclipse.wst.server.core\tmp1\wtpwebapps
六月 02, 2018 12:08:50 下午 org.apache.catalina.startup.VersionLoggerListener log
信息: Command line argument: -Djava.endorsed.dirs=D:\Tomcat 9.0\endorsed
六月 02, 2018 12:08:50 下午 org.apache.catalina.startup.VersionLoggerListener log
信息: Command line argument: -Dfile.encoding=GBK
六月 02, 2018 12:08:50 下午 org.apache.catalina.core.AprLifecycleListener lifecycleEvent
信息: The APR based Apache Tomcat Native library which allows optimal performance in production environments was not found on the java.library.path: D:\Program Files\Java\jdk1.8.0_121\bin;C:\WINDOWS\Sun\Java\bin;C:\WINDOWS\system32;C:\WINDOWS;C:\ProgramData\Oracle\Java\javapath;C:\Windows\system32;C:\Windows;C:\Windows\System32\Wbem;C:\Windows\System32\WindowsPowerShell\v1.0\;C:\Program Files (x86)\NVIDIA Corporation\PhysX\Common;C:\WINDOWS\system32;C:\WINDOWS;C:\WINDOWS\System32\Wbem;C:\WINDOWS\System32\WindowsPowerShell\v1.0\;D:\Python\Python36\Scripts\;D:\Python\Python36\;%USERPROFILE%\AppData\Local\Microsoft\WindowsApps;;C:\Program Files (x86)\SSH Communications Security\SSH Secure Shell;.
六月 02, 2018 12:08:50 下午 org.apache.coyote.AbstractProtocol init
信息: Initializing ProtocolHandler ["http-nio-80"]
六月 02, 2018 12:08:50 下午 org.apache.tomcat.util.net.NioSelectorPool getSharedSelector
信息: Using a shared selector for servlet write/read
六月 02, 2018 12:08:50 下午 org.apache.coyote.AbstractProtocol init
信息: Initializing ProtocolHandler ["ajp-nio-8009"]
六月 02, 2018 12:08:50 下午 org.apache.tomcat.util.net.NioSelectorPool getSharedSelector
信息: Using a shared selector for servlet write/read
六月 02, 2018 12:08:50 下午 org.apache.catalina.startup.Catalina load
信息: Initialization processed in 998 ms
六月 02, 2018 12:08:50 下午 org.apache.catalina.core.StandardService startInternal
信息: Starting service Catalina
六月 02, 2018 12:08:50 下午 org.apache.catalina.core.StandardEngine startInternal
信息: Starting Servlet Engine: Apache Tomcat/9.0.0.M17
六月 02, 2018 12:08:51 下午 org.apache.catalina.core.ContainerBase startInternal
嚴重: A child container failed during start
java.util.concurrent.ExecutionException: org.apache.catalina.LifecycleException: Failed to initialize component [org.apache.catalina.webresources.JarResourceSet@6dbaceb9]
    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:939)
    at org.apache.catalina.core.StandardHost.startInternal(StandardHost.java:872)
    at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:183)
    at org.apache.catalina.core.ContainerBase$StartChild.call(ContainerBase.java:1419)
    at org.apache.catalina.core.ContainerBase$StartChild.call(ContainerBase.java:1409)
    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 initialize component [org.apache.catalina.webresources.JarResourceSet@6dbaceb9]
    at org.apache.catalina.util.LifecycleBase.handleSubClassException(LifecycleBase.java:441)
    at org.apache.catalina.util.LifecycleBase.init(LifecycleBase.java:139)
    at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:173)
    at org.apache.catalina.webresources.StandardRoot.startInternal(StandardRoot.java:708)
    at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:183)
    at org.apache.catalina.core.StandardContext.resourcesStart(StandardContext.java:4832)
    at org.apache.catalina.core.StandardContext.startInternal(StandardContext.java:4964)
    ... 7 more
Caused by: java.lang.IllegalArgumentException: java.util.zip.ZipException: invalid LOC header (bad signature)
    at org.apache.catalina.webresources.AbstractSingleArchiveResourceSet.initInternal(AbstractSingleArchiveResourceSet.java:113)
    at org.apache.catalina.util.LifecycleBase.init(LifecycleBase.java:136)
    ... 12 more
Caused by: java.util.zip.ZipException: invalid LOC header (bad signature)
    at java.util.zip.ZipFile.read(Native Method)
    at java.util.zip.ZipFile.access$1400(ZipFile.java:60)
    at java.util.zip.ZipFile$ZipFileInputStream.read(ZipFile.java:717)
    at java.util.zip.ZipFile$ZipFileInflaterInputStream.fill(ZipFile.java:419)
    at java.util.zip.InflaterInputStream.read(InflaterInputStream.java:158)
    at sun.misc.IOUtils.readFully(IOUtils.java:65)
    at java.util.jar.JarFile.getBytes(JarFile.java:425)
    at java.util.jar.JarFile.getManifestFromReference(JarFile.java:193)
    at java.util.jar.JarFile.getManifest(JarFile.java:180)
    at org.apache.catalina.webresources.AbstractSingleArchiveResourceSet.initInternal(AbstractSingleArchiveResourceSet.java:111)
    ... 13 more

六月 02, 2018 12:08:51 下午 org.apache.catalina.core.ContainerBase startInternal
嚴重: A child container failed during start
java.util.concurrent.ExecutionException: org.apache.catalina.LifecycleException: A child container failed during start
    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:939)
    at org.apache.catalina.core.StandardEngine.startInternal(StandardEngine.java:262)
    at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:183)
    at org.apache.catalina.core.StandardService.startInternal(StandardService.java:422)
    at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:183)
    at org.apache.catalina.core.StandardServer.startInternal(StandardServer.java:793)
    at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:183)
    at org.apache.catalina.startup.Catalina.start(Catalina.java:655)
    at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
    at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
    at java.lang.reflect.Method.invoke(Method.java:498)
    at org.apache.catalina.startup.Bootstrap.start(Bootstrap.java:355)
    at org.apache.catalina.startup.Bootstrap.main(Bootstrap.java:495)
Caused by: org.apache.catalina.LifecycleException: A child container failed during start
    at org.apache.catalina.core.ContainerBase.startInternal(ContainerBase.java:948)
    at org.apache.catalina.core.StandardHost.startInternal(StandardHost.java:872)
    at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:183)
    at org.apache.catalina.core.ContainerBase$StartChild.call(ContainerBase.java:1419)
    at org.apache.catalina.core.ContainerBase$StartChild.call(ContainerBase.java:1409)
    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)

六月 02, 2018 12:08:51 下午 org.apache.catalina.startup.Catalina start
嚴重: The required Server component failed to start so Tomcat is unable to start.
org.apache.catalina.LifecycleException: A child container failed during start
    at org.apache.catalina.core.ContainerBase.startInternal(ContainerBase.java:948)
    at org.apache.catalina.core.StandardEngine.startInternal(StandardEngine.java:262)
    at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:183)
    at org.apache.catalina.core.StandardService.startInternal(StandardService.java:422)
    at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:183)
    at org.apache.catalina.core.StandardServer.startInternal(StandardServer.java:793)
    at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:183)
    at org.apache.catalina.startup.Catalina.start(Catalina.java:655)
    at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
    at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
    at java.lang.reflect.Method.invoke(Method.java:498)
    at org.apache.catalina.startup.Bootstrap.start(Bootstrap.java:355)
    at org.apache.catalina.startup.Bootstrap.main(Bootstrap.java:495)

六月 02, 2018 12:08:51 下午 org.apache.coyote.AbstractProtocol pause
信息: Pausing ProtocolHandler ["http-nio-80"]
六月 02, 2018 12:08:51 下午 org.apache.coyote.AbstractProtocol pause
信息: Pausing ProtocolHandler ["ajp-nio-8009"]
六月 02, 2018 12:08:51 下午 org.apache.catalina.core.StandardService stopInternal
信息: Stopping service Catalina
六月 02, 2018 12:08:51 下午 org.apache.coyote.AbstractProtocol destroy
信息: Destroying ProtocolHandler ["http-nio-80"]
六月 02, 2018 12:08:51 下午 org.apache.coyote.AbstractProtocol destroy
信息: Destroying ProtocolHandler ["ajp-nio-8009"]
View Code

Eclipse報錯以下圖apache

這個錯誤幾乎是致命的,好多同事都遇到了,那麼解決的辦法什麼什麼呢?不少人都是把Tomcat Server刪除了而後從新ADD解決的,可是我這裏連續操做了這個步驟不起做用,也有人說是覺得maven包衝突或者是maven依賴沒有添加致使的,因而個人解決辦法以下tomcat

1:由於懷疑是maven倉庫的問題,因而我從新下載了maven而且配置了環境變量,配置了path變量

http://mirror.bit.edu.cn/apache/maven/maven-3/3.5.3/binaries/apache-maven-3.5.3-bin.zipapp

在命令行測試maven,保證maven環境沒問題eclipse

2:給Eclipse從新配置maven環境

首先,新建一個D:\maven\repository文件夾做爲本地倉庫,默認在C盤個人用戶下面,這裏新建一個目錄方便查找webapp

其次修改D:\apache-maven-3.5.3-bin\conf 咱們從官網下的maven解壓目錄配置目錄中的settings.xml,以下圖maven

而後進入Eclipse進行設置,以下圖咱們輸入新的maven配置文件地址,系統會自動識別到咱們新的本地倉庫位置,點擊apply,點擊OKide

上一步配置OK後,咱們右鍵項目-Maven-Update Project ,Force Update 是強制更新工具

這個時候工具會根據pom.xml從公網倉庫下載所需jar到本地倉庫,下載完成以下圖所示

到這裏配置完成,咱們把項目clean一下,而後把server刪除從新根據Tomcat9建立一個server,右鍵運行發現錯誤再也不發生了

相關文章
相關標籤/搜索