title: Tomcat 8 component start failed due java.util.zip.ZipException
body: <p>I'm tasked on getting old java code to run on newer environment, and I have problem with getting Tomcat (8.0.32) to start component. In catalina.out logfile I get the following:</p>
  
  <pre><code>INFO: Using a shared selector for servlet write/read
  Jul 04, 2019 3:27:30 PM org.apache.catalina.startup.Catalina load
  INFO: Initialization processed in 1232 ms
  Jul 04, 2019 3:27:31 PM org.apache.catalina.core.StandardService startInternal
  INFO: Starting service Catalina
  Jul 04, 2019 3:27:31 PM org.apache.catalina.core.StandardEngine startInternal
  INFO: Starting Servlet Engine: Apache Tomcat/8.0.32 (Ubuntu)
  Jul 04, 2019 3:27:31 PM org.apache.catalina.startup.HostConfig deployDescriptor
  INFO: Deploying configuration descriptor /etc/tomcat8/Catalina/localhost/reportServer.xml
  Jul 04, 2019 3:27:31 PM org.apache.catalina.core.ContainerBase addChildInternal
  SEVERE: ContainerBase.addChild: start: 
  org.apache.catalina.LifecycleException: Failed to start component [StandardEngine[Catalina].StandardHost[localhost].StandardContext[/reportServer]]
      at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:153)
      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.deployDescriptor(HostConfig.java:585)
      at org.apache.catalina.startup.HostConfig$DeployDescriptor.run(HostConfig.java:1794)
      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:1149)
      at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624)
      at java.lang.Thread.run(Thread.java:748)
  Caused by: org.apache.catalina.LifecycleException: Failed to start component [org.apache.catalina.webresources.StandardRoot@79e9c8c8]
      at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:153)
      at org.apache.catalina.core.StandardContext.resourcesStart(StandardContext.java:4937)
      at org.apache.catalina.core.StandardContext.startInternal(StandardContext.java:5067)
      at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:147)
      ... 10 more
  Caused by: org.apache.catalina.LifecycleException: Failed to initialize component [org.apache.catalina.webresources.JarResourceSet@3d9ef955]
      at org.apache.catalina.util.LifecycleBase.init(LifecycleBase.java:107)
      at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:136)
      at org.apache.catalina.webresources.StandardRoot.startInternal(StandardRoot.java:699)
      at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:147)
      ... 13 more
  Caused by: java.lang.IllegalArgumentException: java.util.zip.ZipException: invalid END header (bad central directory offset)
      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: invalid END header (bad central directory offset)
      at java.util.zip.ZipFile.open(Native Method)
      at java.util.zip.ZipFile.&lt;init&gt;(ZipFile.java:225)
      at java.util.zip.ZipFile.&lt;init&gt;(ZipFile.java:155)
      at java.util.jar.JarFile.&lt;init&gt;(JarFile.java:166)
      at java.util.jar.JarFile.&lt;init&gt;(JarFile.java:103)
      at org.apache.catalina.webresources.JarResourceSet.initInternal(JarResourceSet.java:88)
      ... 17 more
  
  Jul 04, 2019 3:27:31 PM org.apache.catalina.startup.HostConfig deployDescriptor
  SEVERE: Error deploying configuration descriptor /etc/tomcat8/Catalina/localhost/reportServer.xml
  java.lang.IllegalStateException: ContainerBase.addChild: start: org.apache.catalina.LifecycleException: Failed to start component [StandardEngine[Catalina].StandardHost[localhost].StandardContext[/reportServer]]
      at org.apache.catalina.core.ContainerBase.addChildInternal(ContainerBase.java:729)
      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.deployDescriptor(HostConfig.java:585)
      at org.apache.catalina.startup.HostConfig$DeployDescriptor.run(HostConfig.java:1794)
      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:1149)
      at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624)
      at java.lang.Thread.run(Thread.java:748)
  </code></pre>
  
  <p>It appears that Tomcat is trying to unzip something, but failing at it. </p>
  
  <p>I'm not too familiar with either java or Tomcat, and so I'm unable to figure out what causes this failure to happen. Is there a common way to figure out what causes this problem? Normally I would try to run the code in question and try to debug that, but it appears that Tomcat environment is needed for running this code, and I cant find the source of the problem.</p>
  
  <p>I also know that this code is successfully running in another virtual (production) server, where some components are older.</p>