title: Deployment on Tomcat 8
body: <p>I was deploying my war file on tomcat 7 locally on linux with java 1.7.0_65 and it was working fine but when I tried to deploy this on remote server with tomcat 8 and java version 1.7.0_71 it failed. Below are the exceptions which I am getting.</p>
  
  <pre><code>28-Jan-2015 10:32:01.831 INFO [localhost-startStop-3] org.apache.catalina.startup.HostConfig.deployWAR Deploying web application archive /etc/apache-tomcat-8.0.15/webapps/1.0.war
  28-Jan-2015 10:32:01.841 SEVERE [localhost-startStop-3] org.apache.catalina.startup.ContextConfig.beforeStart Exception fixing docBase for context [/1.0]
   java.util.zip.ZipException: error in opening zip file
      at java.util.zip.ZipFile.open(Native Method)
      at java.util.zip.ZipFile.&lt;init&gt;(ZipFile.java:215)
      at java.util.zip.ZipFile.&lt;init&gt;(ZipFile.java:145)
      at java.util.jar.JarFile.&lt;init&gt;(JarFile.java:154)
      at java.util.jar.JarFile.&lt;init&gt;(JarFile.java:91)
      at sun.net.www.protocol.jar.URLJarFile.&lt;init&gt;(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:94)
      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:117)
      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:714)
      at org.apache.catalina.startup.HostConfig.deployWAR(HostConfig.java:917)
      at org.apache.catalina.startup.HostConfig$DeployWar.run(HostConfig.java:1701)
      at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:471)
      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)
  
  28-Jan-2015 10:32:01.844 SEVERE [localhost-startStop-3] org.apache.catalina.core.ContainerBase.addChildInternal ContainerBase.addChild: start: 
   org.apache.catalina.LifecycleException: Failed to start component [StandardEngine[Catalina].StandardHost[localhost].StandardContext[/1.0]]
      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:714)
      at org.apache.catalina.startup.HostConfig.deployWAR(HostConfig.java:917)
      at org.apache.catalina.startup.HostConfig$DeployWar.run(HostConfig.java:1701)
      at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:471)
      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 [org.apache.catalina.webresources.StandardRoot@3d42d1b1]
      at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:154)
      at org.apache.catalina.core.StandardContext.resourcesStart(StandardContext.java:4875)
      at org.apache.catalina.core.StandardContext.startInternal(StandardContext.java:5004)
      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@3e0ae509]
      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:680)
      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:97)
      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.&lt;init&gt;(ZipFile.java:215)
      at java.util.zip.ZipFile.&lt;init&gt;(ZipFile.java:145)
      at java.util.jar.JarFile.&lt;init&gt;(JarFile.java:154)
      at java.util.jar.JarFile.&lt;init&gt;(JarFile.java:91)
      at org.apache.catalina.webresources.JarResourceSet.initInternal(JarResourceSet.java:89)
      ... 17 more
  
  28-Jan-2015 10:32:01.846 SEVERE [localhost-startStop-3] org.apache.catalina.startup.HostConfig.deployWAR Error deploying web application archive /etc/apache-tomcat-8.0.15/webapps/1.0.war
   java.lang.IllegalStateException: ContainerBase.addChild: start: org.apache.catalina.LifecycleException: Failed to start component [StandardEngine[Catalina].StandardHost[localhost].StandardContext[/1.0]]
      at org.apache.catalina.core.ContainerBase.addChildInternal(ContainerBase.java:728)
      at org.apache.catalina.core.ContainerBase.addChild(ContainerBase.java:701)
      at org.apache.catalina.core.StandardHost.addChild(StandardHost.java:714)
      at org.apache.catalina.startup.HostConfig.deployWAR(HostConfig.java:917)
      at org.apache.catalina.startup.HostConfig$DeployWar.run(HostConfig.java:1701)
      at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:471)
      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)
  
  28-Jan-2015 10:32:01.847 INFO [localhost-startStop-3] org.apache.catalina.startup.HostConfig.deployWAR Deployment of web application archive /etc/apache-tomcat-8.0.15/webapps/1.0.war has finished in 16 ms
  28-Jan-2015 10:32:11.850 INFO [ContainerBackgroundProcessor[StandardEngine[Catalina]]] org.apache.catalina.startup.HostConfig.undeploy Undeploying context [/1.0]
  28-Jan-2015 10:32:11.852 WARNING [ContainerBackgroundProcessor[StandardEngine[Catalina]]] org.apache.catalina.deploy.NamingResourcesImpl.cleanUp Failed to retrieve JNDI naming context for container [StandardEngine[Catalina].StandardHost[localhost].StandardContext[/1.0]] so no cleanup was performed for that container
   javax.naming.NameNotFoundException: Name [comp/env] is not bound in this Context. Unable to find [comp].
      at org.apache.naming.NamingContext.lookup(NamingContext.java:818)
      at org.apache.naming.NamingContext.lookup(NamingContext.java:166)
      at org.apache.catalina.deploy.NamingResourcesImpl.cleanUp(NamingResourcesImpl.java:993)
      at org.apache.catalina.deploy.NamingResourcesImpl.stopInternal(NamingResourcesImpl.java:975)
      at org.apache.catalina.util.LifecycleBase.stop(LifecycleBase.java:232)
      at org.apache.catalina.core.StandardContext.stopInternal(StandardContext.java:5427)
      at org.apache.catalina.util.LifecycleBase.stop(LifecycleBase.java:232)
      at org.apache.catalina.util.LifecycleBase.destroy(LifecycleBase.java:272)
      at org.apache.catalina.core.ContainerBase.removeChild(ContainerBase.java:841)
      at org.apache.catalina.startup.HostConfig.undeploy(HostConfig.java:1323)
      at org.apache.catalina.startup.HostConfig.checkResources(HostConfig.java:1250)
      at org.apache.catalina.startup.HostConfig.check(HostConfig.java:1471)
      at org.apache.catalina.startup.HostConfig.lifecycleEvent(HostConfig.java:280)
      at org.apache.catalina.util.LifecycleSupport.fireLifecycleEvent(LifecycleSupport.java:117)
      at org.apache.catalina.util.LifecycleBase.fireLifecycleEvent(LifecycleBase.java:90)
      at org.apache.catalina.core.ContainerBase.backgroundProcess(ContainerBase.java:1142)
      at org.apache.catalina.core.ContainerBase$ContainerBackgroundProcessor.processChildren(ContainerBase.java:1378)
      at org.apache.catalina.core.ContainerBase$ContainerBackgroundProcessor.processChildren(ContainerBase.java:1382)
      at org.apache.catalina.core.ContainerBase$ContainerBackgroundProcessor.run(ContainerBase.java:1350)
      at java.lang.Thread.run(Thread.java:745)
  
  28-Jan-2015 10:32:11.857 INFO [localhost-startStop-4] org.apache.catalina.startup.HostConfig.deployWAR Deploying web application archive /etc/apache-tomcat-8.0.15/webapps/1.0.war
  28-Jan-2015 10:32:11.864 SEVERE [localhost-startStop-4] org.apache.catalina.startup.ContextConfig.beforeStart Exception fixing docBase for context [/1.0]
   java.util.zip.ZipException: error in opening zip file
      at java.util.zip.ZipFile.open(Native Method)
      at java.util.zip.ZipFile.&lt;init&gt;(ZipFile.java:215)
      at java.util.zip.ZipFile.&lt;init&gt;(ZipFile.java:145)
      at java.util.jar.JarFile.&lt;init&gt;(JarFile.java:154)
      at java.util.jar.JarFile.&lt;init&gt;(JarFile.java:91)
      at sun.net.www.protocol.jar.URLJarFile.&lt;init&gt;(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:94)
      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:117)
      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:714)
      at org.apache.catalina.startup.HostConfig.deployWAR(HostConfig.java:917)
      at org.apache.catalina.startup.HostConfig$DeployWar.run(HostConfig.java:1701)
      at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:471)
      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)
  
  28-Jan-2015 10:32:11.867 SEVERE [localhost-startStop-4] org.apache.catalina.core.ContainerBase.addChildInternal ContainerBase.addChild: start: 
   org.apache.catalina.LifecycleException: Failed to start component [StandardEngine[Catalina].StandardHost[localhost].StandardContext[/1.0]]
      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:714)
      at org.apache.catalina.startup.HostConfig.deployWAR(HostConfig.java:917)
      at org.apache.catalina.startup.HostConfig$DeployWar.run(HostConfig.java:1701)
      at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:471)
      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 [org.apache.catalina.webresources.StandardRoot@446f1ac7]
      at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:154)
      at org.apache.catalina.core.StandardContext.resourcesStart(StandardContext.java:4875)
      at org.apache.catalina.core.StandardContext.startInternal(StandardContext.java:5004)
      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@1498eef1]
      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:680)
      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:97)
      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.&lt;init&gt;(ZipFile.java:215)
      at java.util.zip.ZipFile.&lt;init&gt;(ZipFile.java:145)
      at java.util.jar.JarFile.&lt;init&gt;(JarFile.java:154)
      at java.util.jar.JarFile.&lt;init&gt;(JarFile.java:91)
      at org.apache.catalina.webresources.JarResourceSet.initInternal(JarResourceSet.java:89)
      ... 17 more
  
  28-Jan-2015 10:32:11.869 SEVERE [localhost-startStop-4] org.apache.catalina.startup.HostConfig.deployWAR Error deploying web application archive /etc/apache-tomcat-8.0.15/webapps/1.0.war
   java.lang.IllegalStateException: ContainerBase.addChild: start: org.apache.catalina.LifecycleException: Failed to start component [StandardEngine[Catalina].StandardHost[localhost].StandardContext[/1.0]]
      at org.apache.catalina.core.ContainerBase.addChildInternal(ContainerBase.java:728)
      at org.apache.catalina.core.ContainerBase.addChild(ContainerBase.java:701)
      at org.apache.catalina.core.StandardHost.addChild(StandardHost.java:714)
      at org.apache.catalina.startup.HostConfig.deployWAR(HostConfig.java:917)
      at org.apache.catalina.startup.HostConfig$DeployWar.run(HostConfig.java:1701)
      at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:471)
      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)
  
  28-Jan-2015 10:32:11.869 INFO [localhost-startStop-4] org.apache.catalina.startup.HostConfig.deployWAR Deployment of web application archive /etc/apache-tomcat-8.0.15/webapps/1.0.war has finished in 12 ms
  28-Jan-2015 10:32:21.872 INFO [ContainerBackgroundProcessor[StandardEngine[Catalina]]] org.apache.catalina.startup.HostConfig.undeploy Undeploying context [/1.0]
  28-Jan-2015 10:32:21.874 WARNING [ContainerBackgroundProcessor[StandardEngine[Catalina]]] org.apache.catalina.deploy.NamingResourcesImpl.cleanUp Failed to retrieve JNDI naming context for container [StandardEngine[Catalina].StandardHost[localhost].StandardContext[/1.0]] so no cleanup was performed for that container
   javax.naming.NameNotFoundException: Name [comp/env] is not bound in this Context. Unable to find [comp].
      at org.apache.naming.NamingContext.lookup(NamingContext.java:818)
      at org.apache.naming.NamingContext.lookup(NamingContext.java:166)
      at org.apache.catalina.deploy.NamingResourcesImpl.cleanUp(NamingResourcesImpl.java:993)
      at org.apache.catalina.deploy.NamingResourcesImpl.stopInternal(NamingResourcesImpl.java:975)
      at org.apache.catalina.util.LifecycleBase.stop(LifecycleBase.java:232)
      at org.apache.catalina.core.StandardContext.stopInternal(StandardContext.java:5427)
      at org.apache.catalina.util.LifecycleBase.stop(LifecycleBase.java:232)
      at org.apache.catalina.util.LifecycleBase.destroy(LifecycleBase.java:272)
      at org.apache.catalina.core.ContainerBase.removeChild(ContainerBase.java:841)
      at org.apache.catalina.startup.HostConfig.undeploy(HostConfig.java:1323)
      at org.apache.catalina.startup.HostConfig.checkResources(HostConfig.java:1250)
      at org.apache.catalina.startup.HostConfig.check(HostConfig.java:1471)
      at org.apache.catalina.startup.HostConfig.lifecycleEvent(HostConfig.java:280)
      at org.apache.catalina.util.LifecycleSupport.fireLifecycleEvent(LifecycleSupport.java:117)
      at org.apache.catalina.util.LifecycleBase.fireLifecycleEvent(LifecycleBase.java:90)
      at org.apache.catalina.core.ContainerBase.backgroundProcess(ContainerBase.java:1142)
      at org.apache.catalina.core.ContainerBase$ContainerBackgroundProcessor.processChildren(ContainerBase.java:1378)
      at org.apache.catalina.core.ContainerBase$ContainerBackgroundProcessor.processChildren(ContainerBase.java:1382)
      at org.apache.catalina.core.ContainerBase$ContainerBackgroundProcessor.run(ContainerBase.java:1350)
      at java.lang.Thread.run(Thread.java:745)
  
  28-Jan-2015 10:32:21.877 INFO [localhost-startStop-5] org.apache.catalina.startup.HostConfig.deployWAR Deploying web application archive /etc/apache-tomcat-8.0.15/webapps/1.0.war
  28-Jan-2015 10:32:24.647 SEVERE [localhost-startStop-5] org.apache.catalina.core.StandardContext.startInternal Error listenerStart
  28-Jan-2015 10:32:24.648 SEVERE [localhost-startStop-5] org.apache.catalina.core.StandardContext.startInternal Context [/1.0] startup failed due to previous errors
  </code></pre>
  
  <p>and my web.xml is</p>
  
  <pre><code>&lt;?xml version="1.0" encoding="UTF-8"?&gt;
  &lt;web-app xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns="http://java.sun.com/xml/ns/javaee" xsi:schemaLocation="http://java.sun.com/xml/ns/javaee http://java.sun.com/xml/ns/javaee/web-app_3_0.xsd" id="WebApp_ID" version="3.0"&gt;
    &lt;display-name&gt;mydb&lt;/display-name&gt;
    &lt;welcome-file-list&gt;
      &lt;welcome-file&gt;index.html&lt;/welcome-file&gt;
      &lt;welcome-file&gt;index.htm&lt;/welcome-file&gt;
      &lt;welcome-file&gt;index.jsp&lt;/welcome-file&gt;
      &lt;welcome-file&gt;default.html&lt;/welcome-file&gt;
      &lt;welcome-file&gt;default.htm&lt;/welcome-file&gt;
      &lt;welcome-file&gt;default.jsp&lt;/welcome-file&gt;
    &lt;/welcome-file-list&gt;
  
    &lt;resource-ref&gt;
        &lt;description&gt;DB Connection&lt;/description&gt;
        &lt;res-ref-name&gt;jdbc/mydb&lt;/res-ref-name&gt;
        &lt;res-type&gt;javax.sql.DataSource&lt;/res-type&gt;
        &lt;res-auth&gt;Container&lt;/res-auth&gt;
    &lt;/resource-ref&gt;
  
  
    &lt;servlet&gt;
      &lt;servlet-name&gt;Jersey REST Service&lt;/servlet-name&gt;
      &lt;servlet-class&gt;com.sun.jersey.spi.container.servlet.ServletContainer&lt;/servlet-class&gt;
      &lt;init-param&gt;
        &lt;param-name&gt;com.sun.jersey.config.property.packages&lt;/param-name&gt;
        &lt;param-value&gt;com.example.mydb.api.restcalls&lt;/param-value&gt;
      &lt;/init-param&gt;
      &lt;load-on-startup&gt;1&lt;/load-on-startup&gt;
    &lt;/servlet&gt;
    &lt;servlet-mapping&gt;
      &lt;servlet-name&gt;Jersey REST Service&lt;/servlet-name&gt;
      &lt;url-pattern&gt;/*&lt;/url-pattern&gt;
    &lt;/servlet-mapping&gt;
  
  
  
  
  
  &lt;/web-app&gt;
  </code></pre>
  
  <p>Any guess why it's not working?</p>