tomcat启动报错:java.util.zip.ZipException的解决方法
发现问题
早上起来报错误,Jenkins打包到tomcat服务器,死活启动不起来,一些定时任务也没跑成功。
报错如下:
org.apache.catalina.startup.ContextConfig.beforeStartExceptionfixingdocBaseforcontext[/test] java.util.zip.ZipException:errorinopeningzipfile atjava.util.zip.ZipFile.open(NativeMethod) atjava.util.zip.ZipFile.(ZipFile.java:219) atjava.util.zip.ZipFile. (ZipFile.java:149) atjava.util.jar.JarFile. (JarFile.java:166) atjava.util.jar.JarFile. (JarFile.java:103) atsun.net.www.protocol.jar.URLJarFile. (URLJarFile.java:93) atsun.net.www.protocol.jar.URLJarFile.getJarFile(URLJarFile.java:69) atsun.net.www.protocol.jar.JarFileFactory.get(JarFileFactory.java:99) atsun.net.www.protocol.jar.JarURLConnection.connect(JarURLConnection.java:122) atsun.net.www.protocol.jar.JarURLConnection.getJarFile(JarURLConnection.java:89) atorg.apache.catalina.startup.ExpandWar.expand(ExpandWar.java:130) atorg.apache.catalina.startup.ContextConfig.fixDocBase(ContextConfig.java:618) atorg.apache.catalina.startup.ContextConfig.beforeStart(ContextConfig.java:744) atorg.apache.catalina.startup.ContextConfig.lifecycleEvent(ContextConfig.java:307) atorg.apache.catalina.util.LifecycleSupport.fireLifecycleEvent(LifecycleSupport.java:95) atorg.apache.catalina.util.LifecycleBase.fireLifecycleEvent(LifecycleBase.java:90) atorg.apache.catalina.util.LifecycleBase.setStateInternal(LifecycleBase.java:402) atorg.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:147) atorg.apache.catalina.core.ContainerBase.addChildInternal(ContainerBase.java:725) atorg.apache.catalina.core.ContainerBase.addChild(ContainerBase.java:701) atorg.apache.catalina.core.StandardHost.addChild(StandardHost.java:717) atorg.apache.catalina.startup.HostConfig.deployWAR(HostConfig.java:945) atorg.apache.catalina.startup.HostConfig$DeployWar.run(HostConfig.java:1795) atjava.util.concurrent.Executors$RunnableAdapter.call(Executors.java:511) atjava.util.concurrent.FutureTask.run(FutureTask.java:266) atjava.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142) atjava.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617) atjava.lang.Thread.run(Thread.java:745) 04-Jan-201809:23:43.063SEVERE[localhost-startStop-1]org.apache.catalina.core.ContainerBase.addChildInternalContainerBase.addChild:start: org.apache.catalina.LifecycleException:Failedtostartcomponent[StandardEngine[Catalina].StandardHost[localhost].StandardContext[/test]] atorg.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:154) atorg.apache.catalina.core.ContainerBase.addChildInternal(ContainerBase.java:725) atorg.apache.catalina.core.ContainerBase.addChild(ContainerBase.java:701) atorg.apache.catalina.core.StandardHost.addChild(StandardHost.java:717) atorg.apache.catalina.startup.HostConfig.deployWAR(HostConfig.java:945) atorg.apache.catalina.startup.HostConfig$DeployWar.run(HostConfig.java:1795) atjava.util.concurrent.Executors$RunnableAdapter.call(Executors.java:511) atjava.util.concurrent.FutureTask.run(FutureTask.java:266) atjava.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142) atjava.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617) atjava.lang.Thread.run(Thread.java:745) Causedby:org.apache.catalina.LifecycleException:Failedtostartcomponent[org.apache.catalina.webresources.StandardRoot@778c717c] atorg.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:154) atorg.apache.catalina.core.StandardContext.resourcesStart(StandardContext.java:4928) atorg.apache.catalina.core.StandardContext.startInternal(StandardContext.java:5058) atorg.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:150) ...10more Causedby:org.apache.catalina.LifecycleException:Failedtoinitializecomponent[org.apache.catalina.webresources.JarResourceSet@5067d644] atorg.apache.catalina.util.LifecycleBase.init(LifecycleBase.java:106) atorg.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:139) atorg.apache.catalina.webresources.StandardRoot.startInternal(StandardRoot.java:690) atorg.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:150) ...13more Causedby:java.lang.IllegalArgumentException:java.util.zip.ZipException:errorinopeningzipfile atorg.apache.catalina.webresources.JarResourceSet.initInternal(JarResourceSet.java:96) atorg.apache.catalina.util.LifecycleBase.init(LifecycleBase.java:102) ...16more Causedby:java.util.zip.ZipException:errorinopeningzipfile atjava.util.zip.ZipFile.open(NativeMethod) atjava.util.zip.ZipFile. (ZipFile.java:219) atjava.util.zip.ZipFile. (ZipFile.java:149) atjava.util.jar.JarFile. (JarFile.java:166) atjava.util.jar.JarFile. (JarFile.java:103) atorg.apache.catalina.webresources.JarResourceSet.initInternal(JarResourceSet.java:88) ...17more
解决方法
纠结了半天,发现tomcat/webapps/test.war包,没有解压,搜了一会资料,各种遇到的问题似乎都不一样,以为war包有问题,自己手动传了一个进去,也没解决,同时也没解压。我看了一下磁盘空间,。
[]#df-h FilesystemSizeUsedAvailUse%Mountedon /dev/mapper/VolGroup-lv_root45G45G0100%/ tmpfs16G72K16G1%/dev/shm /dev/sda1485M40M421M9%/boot
发现磁盘空间满了,删掉一些日志文件,清理一些垃圾历史文件,腾出一些磁盘空间,好嘛,解决了,可以部署了,启动也没报错。
总结
以上就是这篇文章的全部内容了,希望本文的内容对大家的学习或者工作具有一定的参考学习价值,如果有疑问大家可以留言交流,谢谢大家对毛票票的支持。