Tomcat启动报错:org.apache.catalina.LifecycleException: Failed to start component...java.util.zip.ZipException: error in opening zip file
1.项目环境
IntelliJ IDEA2018.1.6
apache-tomcat-8.0.53
基于springboot开发的项目
maven3.5.3
2.出现问题
从svn同步下项目
启动tomcat运行每次都提示以下错误:
1 org.apache.catalina.LifecycleException: Failed to start component [StandardEngine[Catalina].StandardHost[localhost].StandardContext[/UserInterface-1.0-SNAPSHOT]] 2 at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:154) 3 at org.apache.catalina.core.ContainerBase.addChildInternal(ContainerBase.java:725) 4 at org.apache.catalina.core.ContainerBase.addChild(ContainerBase.java:701) 5 at org.apache.catalina.core.StandardHost.addChild(StandardHost.java:717) 6 at org.apache.catalina.startup.HostConfig.deployWAR(HostConfig.java:945) 7 at org.apache.catalina.startup.HostConfig$DeployWar.run(HostConfig.java:1795) 8 at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:511) 9 at java.util.concurrent.FutureTask.run(FutureTask.java:266) 10 at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142) 11 at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617) 12 at java.lang.Thread.run(Thread.java:745) 13 Caused by: org.apache.catalina.LifecycleException: Failed to start component [org.apache.catalina.webresources.StandardRoot@6da9455d] 14 at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:154) 15 at org.apache.catalina.core.StandardContext.resourcesStart(StandardContext.java:4928) 16 at org.apache.catalina.core.StandardContext.startInternal(StandardContext.java:5058) 17 at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:150) 18 ... 10 more 19 Caused by: org.apache.catalina.LifecycleException: Failed to initialize component [org.apache.catalina.webresources.JarResourceSet@6e366f32] 20 at org.apache.catalina.util.LifecycleBase.init(LifecycleBase.java:106) 21 at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:139) 22 at org.apache.catalina.webresources.StandardRoot.startInternal(StandardRoot.java:699) 23 at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:150) 24 ... 13 more 25 Caused by: java.lang.IllegalArgumentException: java.util.zip.ZipException: error in opening zip file 26 at org.apache.catalina.webresources.JarResourceSet.initInternal(JarResourceSet.java:96) 27 at org.apache.catalina.util.LifecycleBase.init(LifecycleBase.java:102) 28 ... 16 more 29 Caused by: java.util.zip.ZipException: error in opening zip file 30 at java.util.zip.ZipFile.open(Native Method) 31 at java.util.zip.ZipFile.<init>(ZipFile.java:219) 32 at java.util.zip.ZipFile.<init>(ZipFile.java:149) 33 at java.util.jar.JarFile.<init>(JarFile.java:166) 34 at java.util.jar.JarFile.<init>(JarFile.java:103) 35 at org.apache.catalina.webresources.JarResourceSet.initInternal(JarResourceSet.java:88) 36 ... 17 more
同事那边项目能正常运行,开始怀疑tomcat出现的问题;
几经替换,用新的tomcat都没有效果,继续报此错。
郁闷之中。。。
3.问题解决
怀疑环境哪里出现了问题,之前出现过一次jar包的问题,这次会不会也是那种问题??
从报错的信息 不能初始化组件等 没有找到太多有效信息。。难过
不知如何进行jar包排查,难道一个一个来??
正愁找不到一个切入点。。
看到网上有人说删除掉maven仓库的神奇方法,
于是找到maven的安装路径进行删除所有仓库文件
神奇的事情发生了。。
问题就此解决。
解决方法:
删除maven的仓库中所有的jar包。(比如找到 C:\Users\tipray\.m2\repository 删除路径下所有文件)