欢迎您访问程序员文章站本站旨在为大家提供分享程序员计算机编程知识!
您现在的位置是: 首页  >  网络运营

tomcat启动报错:java.util.zip.ZipException的解决方法

程序员文章站 2022-03-19 08:23:02
发现问题 早上起来报错误,jenkins打包到tomcat服务器,死活启动不起来,一些定时任务也没跑成功。 报错如下: org.apache.catali...

发现问题

早上起来报错误,jenkins打包到tomcat服务器,死活启动不起来,一些定时任务也没跑成功。

报错如下:

org.apache.catalina.startup.contextconfig.beforestart exception fixing docbase for context [/test]
 java.util.zip.zipexception: error in opening zip file
 at java.util.zip.zipfile.open(native method)
 at java.util.zip.zipfile.<init>(zipfile.java:219)
 at java.util.zip.zipfile.<init>(zipfile.java:149)
 at java.util.jar.jarfile.<init>(jarfile.java:166)
 at java.util.jar.jarfile.<init>(jarfile.java:103)
 at sun.net.www.protocol.jar.urljarfile.<init>(urljarfile.java:93)
 at sun.net.www.protocol.jar.urljarfile.getjarfile(urljarfile.java:69)
 at sun.net.www.protocol.jar.jarfilefactory.get(jarfilefactory.java:99)
 at sun.net.www.protocol.jar.jarurlconnection.connect(jarurlconnection.java:122)
 at sun.net.www.protocol.jar.jarurlconnection.getjarfile(jarurlconnection.java:89)
 at org.apache.catalina.startup.expandwar.expand(expandwar.java:130)
 at org.apache.catalina.startup.contextconfig.fixdocbase(contextconfig.java:618)
 at org.apache.catalina.startup.contextconfig.beforestart(contextconfig.java:744)
 at org.apache.catalina.startup.contextconfig.lifecycleevent(contextconfig.java:307)
 at org.apache.catalina.util.lifecyclesupport.firelifecycleevent(lifecyclesupport.java:95)
 at org.apache.catalina.util.lifecyclebase.firelifecycleevent(lifecyclebase.java:90)
 at org.apache.catalina.util.lifecyclebase.setstateinternal(lifecyclebase.java:402)
 at org.apache.catalina.util.lifecyclebase.start(lifecyclebase.java:147)
 at org.apache.catalina.core.containerbase.addchildinternal(containerbase.java:725)
 at org.apache.catalina.core.containerbase.addchild(containerbase.java:701)
 at org.apache.catalina.core.standardhost.addchild(standardhost.java:717)
 at org.apache.catalina.startup.hostconfig.deploywar(hostconfig.java:945)
 at org.apache.catalina.startup.hostconfig$deploywar.run(hostconfig.java:1795)
 at java.util.concurrent.executors$runnableadapter.call(executors.java:511)
 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)

04-jan-2018 09:23:43.063 severe [localhost-startstop-1] org.apache.catalina.core.containerbase.addchildinternal containerbase.addchild: start: 
 org.apache.catalina.lifecycleexception: failed to start component [standardengine[catalina].standardhost[localhost].standardcontext[/test]]
 at org.apache.catalina.util.lifecyclebase.start(lifecyclebase.java:154)
 at org.apache.catalina.core.containerbase.addchildinternal(containerbase.java:725)
 at org.apache.catalina.core.containerbase.addchild(containerbase.java:701)
 at org.apache.catalina.core.standardhost.addchild(standardhost.java:717)
 at org.apache.catalina.startup.hostconfig.deploywar(hostconfig.java:945)
 at org.apache.catalina.startup.hostconfig$deploywar.run(hostconfig.java:1795)
 at java.util.concurrent.executors$runnableadapter.call(executors.java:511)
 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 start component [org.apache.catalina.webresources.standardroot@778c717c]
 at org.apache.catalina.util.lifecyclebase.start(lifecyclebase.java:154)
 at org.apache.catalina.core.standardcontext.resourcesstart(standardcontext.java:4928)
 at org.apache.catalina.core.standardcontext.startinternal(standardcontext.java:5058)
 at org.apache.catalina.util.lifecyclebase.start(lifecyclebase.java:150)
 ... 10 more
caused by: org.apache.catalina.lifecycleexception: failed to initialize component [org.apache.catalina.webresources.jarresourceset@5067d644]
 at org.apache.catalina.util.lifecyclebase.init(lifecyclebase.java:106)
 at org.apache.catalina.util.lifecyclebase.start(lifecyclebase.java:139)
 at org.apache.catalina.webresources.standardroot.startinternal(standardroot.java:690)
 at org.apache.catalina.util.lifecyclebase.start(lifecyclebase.java:150)
 ... 13 more
caused by: java.lang.illegalargumentexception: java.util.zip.zipexception: error in opening zip file
 at org.apache.catalina.webresources.jarresourceset.initinternal(jarresourceset.java:96)
 at org.apache.catalina.util.lifecyclebase.init(lifecyclebase.java:102)
 ... 16 more
caused by: java.util.zip.zipexception: error in opening zip file
 at java.util.zip.zipfile.open(native method)
 at java.util.zip.zipfile.<init>(zipfile.java:219)
 at java.util.zip.zipfile.<init>(zipfile.java:149)
 at java.util.jar.jarfile.<init>(jarfile.java:166)
 at java.util.jar.jarfile.<init>(jarfile.java:103)
 at org.apache.catalina.webresources.jarresourceset.initinternal(jarresourceset.java:88)
 ... 17 more

解决方法

纠结了半天,发现tomcat/webapps/test.war包,没有解压,搜了一会资料,各种遇到的问题似乎都不一样,以为war包有问题,自己手动传了一个进去,也没解决,同时也没解压。我看了一下磁盘空间,。

[]# df -h
filesystem   size used avail use% mounted on
/dev/mapper/volgroup-lv_root 45g 45g 0 100% /
tmpfs    16g 72k 16g 1% /dev/shm
/dev/sda1   485m 40m 421m 9% /boot

发现磁盘空间满了,删掉一些日志文件,清理一些垃圾历史文件,腾出一些磁盘空间,好嘛,解决了,可以部署了,启动也没报错。

总结

以上就是这篇文章的全部内容了,希望本文的内容对大家的学习或者工作具有一定的参考学习价值,如果有疑问大家可以留言交流,谢谢大家对的支持。