Deploying the war package to tomcat due to project needs, the start-up time is wrong:
31-Oct-2018 09:11:18.555 information [ContainerBackgroundProcessor[StandardEngine[Catalina]]] org.apache.catalina.startup.HostConfig.deployWAR Deploying web application archive [D:\Program Files\Apache Software Foundation\Tomcat 9.0_Tomcat9.0\webapps\mdnp.war] 31-Oct-2018 09:11:27.725 serious [ContainerBackgroundProcessor[StandardEngine[Catalina]]] org.apache.catalina.core.ContainerBase.addChildInternal ContainerBase.addChild: start: org.apache.catalina.LifecycleException: Failed to initialize component [org.apache.catalina.webresources.JarResourceSet@2d501572] at org.apache.catalina.util.LifecycleBase.handleSubClassException(LifecycleBase.java:441) at org.apache.catalina.util.LifecycleBase.init(LifecycleBase.java:139) at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:173) at org.apache.catalina.webresources.StandardRoot.startInternal(StandardRoot.java:724) at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:183) at org.apache.catalina.core.StandardContext.resourcesStart(StandardContext.java:4758) at org.apache.catalina.core.StandardContext.startInternal(StandardContext.java:4893) at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:183) at org.apache.catalina.core.ContainerBase.addChildInternal(ContainerBase.java:742) at org.apache.catalina.core.ContainerBase.addChild(ContainerBase.java:718) at org.apache.catalina.core.StandardHost.addChild(StandardHost.java:703) at org.apache.catalina.startup.HostConfig.deployWAR(HostConfig.java:986) at org.apache.catalina.startup.HostConfig$DeployWar.run(HostConfig.java:1858) at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:511) at java.util.concurrent.FutureTask.run(FutureTask.java:266) at org.apache.tomcat.util.threads.InlineExecutorService.execute(InlineExecutorService.java:75) at java.util.concurrent.AbstractExecutorService.submit(AbstractExecutorService.java:112) at org.apache.catalina.startup.HostConfig.deployWARs(HostConfig.java:772) at org.apache.catalina.startup.HostConfig.deployApps(HostConfig.java:426) at org.apache.catalina.startup.HostConfig.check(HostConfig.java:1629) at org.apache.catalina.startup.HostConfig.lifecycleEvent(HostConfig.java:304) at org.apache.catalina.util.LifecycleBase.fireLifecycleEvent(LifecycleBase.java:123) at org.apache.catalina.core.ContainerBase.backgroundProcess(ContainerBase.java:1174) at org.apache.catalina.core.ContainerBase$ContainerBackgroundProcessor.processChildren(ContainerBase.java:1396) at org.apache.catalina.core.ContainerBase$ContainerBackgroundProcessor.processChildren(ContainerBase.java:1400) at org.apache.catalina.core.ContainerBase$ContainerBackgroundProcessor.run(ContainerBase.java:1368) at java.lang.Thread.run(Thread.java:748) Caused by: java.lang.IllegalArgumentException: java.util.zip.ZipException: invalid LOC header (bad signature) at org.apache.catalina.webresources.AbstractSingleArchiveResourceSet.initInternal(AbstractSingleArchiveResourceSet.java:143) at org.apache.catalina.util.LifecycleBase.init(LifecycleBase.java:136) ... 25 more Caused by: java.util.zip.ZipException: invalid LOC header (bad signature) at java.util.zip.ZipFile.read(Native Method) at java.util.zip.ZipFile.access$1400(ZipFile.java:60) at java.util.zip.ZipFile$ZipFileInputStream.read(ZipFile.java:734) at java.util.zip.ZipFile$ZipFileInflaterInputStream.fill(ZipFile.java:434) at java.util.zip.InflaterInputStream.read(InflaterInputStream.java:158) at sun.misc.IOUtils.readFully(IOUtils.java:65) at java.util.jar.JarFile.getBytes(JarFile.java:425) at java.util.jar.JarFile.getManifestFromReference(JarFile.java:193) at java.util.jar.JarFile.getManifest(JarFile.java:180) at org.apache.catalina.webresources.AbstractSingleArchiveResourceSet.initInternal(AbstractSingleArchiveResourceSet.java:141) ... 26 more 31-Oct-2018 09:11:27.729 serious [ContainerBackgroundProcessor[StandardEngine[Catalina]]] org.apache.catalina.startup.HostConfig.deployWAR Error deploying web application archive [D:\Program Files\Apache Software Foundation\Tomcat 9.0_Tomcat9.0\webapps\mdnp.war] java.lang.IllegalStateException: ContainerBase.addChild: start: org.apache.catalina.LifecycleException: Failed to initialize component [org.apache.catalina.webresources.JarResourceSet@2d501572] at org.apache.catalina.core.ContainerBase.addChildInternal(ContainerBase.java:746) at org.apache.catalina.core.ContainerBase.addChild(ContainerBase.java:718) at org.apache.catalina.core.StandardHost.addChild(StandardHost.java:703) at org.apache.catalina.startup.HostConfig.deployWAR(HostConfig.java:986) at org.apache.catalina.startup.HostConfig$DeployWar.run(HostConfig.java:1858) at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:511) at java.util.concurrent.FutureTask.run(FutureTask.java:266) at org.apache.tomcat.util.threads.InlineExecutorService.execute(InlineExecutorService.java:75) at java.util.concurrent.AbstractExecutorService.submit(AbstractExecutorService.java:112) at org.apache.catalina.startup.HostConfig.deployWARs(HostConfig.java:772) at org.apache.catalina.startup.HostConfig.deployApps(HostConfig.java:426) at org.apache.catalina.startup.HostConfig.check(HostConfig.java:1629) at org.apache.catalina.startup.HostConfig.lifecycleEvent(HostConfig.java:304) at org.apache.catalina.util.LifecycleBase.fireLifecycleEvent(LifecycleBase.java:123) at org.apache.catalina.core.ContainerBase.backgroundProcess(ContainerBase.java:1174) at org.apache.catalina.core.ContainerBase$ContainerBackgroundProcessor.processChildren(ContainerBase.java:1396) at org.apache.catalina.core.ContainerBase$ContainerBackgroundProcessor.processChildren(ContainerBase.java:1400) at org.apache.catalina.core.ContainerBase$ContainerBackgroundProcessor.run(ContainerBase.java:1368) at java.lang.Thread.run(Thread.java:748) 31-Oct-2018 09:11:27.738 information [ContainerBackgroundProcessor[StandardEngine[Catalina]]] org.apache.catalina.startup.HostConfig.deployWAR Deployment of web application archive [D:\Program Files\Apache Software Foundation\Tomcat 9.0_Tomcat9.0\webapps\mdnp.war] has finished in [9,182] ms
According to the error prompt, it is suspected that the jar package is damaged.
To locate which jar package is, test the jar package with the jar command using the following shell script:
for j in *.jar; do echo $j; jar tvf $j > /dev/null ; echo $j done; done
Because my computer operating system is Windows 10, I can't execute shell scripts. Because I installed git on my computer before, I used git client to execute shell scripts.
Specific operation steps:
Find the location of the deployment of the project war package, and then find the directory extracted by the corresponding war package, and enter the lib under the directory WEB-INF; right-click the Git Bash Here option in the blank of the directory, and you can. Enter commands as shown in Figure 1
After running, you will see the error prompt: