tomcat的war由于损坏不能解压导致的服务不能启动

Posted mvpbang

tags:

篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了tomcat的war由于损坏不能解压导致的服务不能启动相关的知识,希望对你有一定的参考价值。

问题描述:

  Tomcat启动,提示异常,服务自动释放!

INFO: Starting Servlet Engine: Apache Tomcat/7.0.81
Sep 30, 2018 7:11:56 PM org.apache.catalina.core.ContainerBase startInternal
SEVERE: A child container failed during start
java.util.concurrent.ExecutionException: org.apache.catalina.LifecycleException: Failed to start component [StandardEngine[Catalina].StandardHost[localhost].StandardContext[/yhs-web]]
    at java.util.concurrent.FutureTask.report(FutureTask.java:122)
    at java.util.concurrent.FutureTask.get(FutureTask.java:188)
    at org.apache.catalina.core.ContainerBase.startInternal(ContainerBase.java:1233)
    at org.apache.catalina.core.StandardHost.startInternal(StandardHost.java:819)
    at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:145)
    at org.apache.catalina.core.ContainerBase$StartChild.call(ContainerBase.java:1694)
    at org.apache.catalina.core.ContainerBase$StartChild.call(ContainerBase.java:1684)
    at java.util.concurrent.FutureTask.run(FutureTask.java:262)
    at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1145)
    at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:615)
    at java.lang.Thread.run(Thread.java:745)
Caused by: org.apache.catalina.LifecycleException: Failed to start component [StandardEngine[Catalina].StandardHost[localhost].StandardContext[/yhs-web]]
    at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:162)
    ... 6 more
Caused by: java.lang.IllegalArgumentException: MALFORMED  //畸形的war
    at java.util.zip.ZipCoder.toString(ZipCoder.java:58)
    at java.util.zip.ZipFile.getZipEntry(ZipFile.java:531)  //xxx.war ==> xxx.zip 
    at java.util.zip.ZipFile.access$900(ZipFile.java:56)
    at java.util.zip.ZipFile$1.nextElement(ZipFile.java:513)
    at java.util.zip.ZipFile$1.nextElement(ZipFile.java:483)
    at java.util.jar.JarFile$1.nextElement(JarFile.java:244)
    at java.util.jar.JarFile$1.nextElement(JarFile.java:239)
    at org.apache.catalina.startup.ExpandWar.expand(ExpandWar.java:114)
    at org.apache.catalina.startup.ContextConfig.fixDocBase(ContextConfig.java:737)
    at org.apache.catalina.startup.ContextConfig.beforeStart(ContextConfig.java:862)
    at org.apache.catalina.startup.ContextConfig.lifecycleEvent(ContextConfig.java:390)
    at org.apache.catalina.util.LifecycleSupport.fireLifecycleEvent(LifecycleSupport.java:117)
    at org.apache.catalina.util.LifecycleBase.fireLifecycleEvent(LifecycleBase.java:90)
    at org.apache.catalina.util.LifecycleBase.setStateInternal(LifecycleBase.java:388)
    at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:144)
    ... 6 more

问题解决:

  01、人工解压到制定的目录webapps/yhs-web/

  02、或者重新打包,部署!

以上是关于tomcat的war由于损坏不能解压导致的服务不能启动的主要内容,如果未能解决你的问题,请参考以下文章

Linux Tomcat8无法解压war包

Gradle Spring Boot 项目不能在 Tomcat 中作为 WAR 工作

自动部署批处理

Nginx和Tomcat配合实现Java Web服务热部署

tomcat war包解压问题

把war包放到Tomcat安装文件夹下,不能直接訪问的解决方式