启动spring boot项目的时候遇到了报错:
-Sep- ::15.513 INFO [main] org.apache.catalina.core.StandardService.startInternal Starting service [Catalina]
-Sep- ::15.513 INFO [main] org.apache.catalina.core.StandardEngine.startInternal Starting Servlet Engine: Apache Tomcat/8.5.
-Sep- ::15.519 INFO [localhost-startStop-] org.apache.catalina.startup.HostConfig.deployDirectory Deploying web application directory [/data/tomcat-rest/webapps/ROOT]
-Sep- ::15.601 SEVERE [localhost-startStop-] org.apache.catalina.core.ContainerBase.addChildInternal ContainerBase.addChild: start: org.apache.catalina.LifecycleException: Failed to start component [StandardEngine[Catalina].StandardHost[localhost].StandardContext[]]
at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:) at org.apache.catalina.core.ContainerBase.addChildInternal(ContainerBase.java:)
at org.apache.catalina.core.ContainerBase.addChild(ContainerBase.java:)
at org.apache.catalina.core.StandardHost.addChild(StandardHost.java:)
at org.apache.catalina.startup.HostConfig.deployDirectory(HostConfig.java:)
at org.apache.catalina.startup.HostConfig$DeployDirectory.run(HostConfig.java:)
at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:)
at java.util.concurrent.FutureTask.run(FutureTask.java:)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:)
at java.lang.Thread.run(Thread.java:)
Caused by: org.apache.catalina.LifecycleException: Failed to start component [org.apache.catalina.webresources.StandardRoot@7486495e]
at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:)
at org.apache.catalina.core.StandardContext.resourcesStart(StandardContext.java:)
at org.apache.catalina.core.StandardContext.startInternal(StandardContext.java:)
at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:)
... more
Caused by: org.apache.catalina.LifecycleException: Failed to initialize component [org.apache.catalina.webresources.JarResourceSet@3a5ff23e]
at org.apache.catalina.util.LifecycleBase.init(LifecycleBase.java:)
at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:)
at org.apache.catalina.webresources.StandardRoot.startInternal(StandardRoot.java:)
at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:)
... more
Caused by: java.lang.IllegalArgumentException: java.util.zip.ZipException: invalid LOC header (bad signature)
at org.apache.catalina.webresources.AbstractSingleArchiveResourceSet.initInternal(AbstractSingleArchiveResourceSet.java:)
at org.apache.catalina.util.LifecycleBase.init(LifecycleBase.java:)
仔细分析后发现 :
A child container failed during start 从来都不是问题的根本原因!
而本问题的根本原因是:
java.util.zip.ZipException: invalid LOC header (bad signature)
后来根据本地maven install时发现是由于本地的jar包下载的时候出错导致的
然后根据报错信息删除对应的jar包的文件夹
重新编译后通过。