title: Getting "Unable to open nested compressed entry" when making use of WarLauncher for executing a war file outside of servlet container
body: <p>I am implementing a war file which should support execution in two different ways:</p>
  
  <ol>
  <li>Inside Servlet Container - by deploying it in Tomcat or Jetty.</li>
  <li>Outside Servlet Container - executing it from command prompt and not using any embedded servlet container. This is required to be supported as part of the war file.</li>
  </ol>
  
  <p>I found Spring Boot Loader component more relevant for fulfilling #2. I tried using it manually before integrating it with Maven. I followed the section - 'WAR file structure' as mentioned as per <a href="https://github.com/spring-projects/spring-boot/tree/master/spring-boot-tools/spring-boot-loader" rel="nofollow">this</a> documentation. Refer to section 'WAR file structure'.</p>
  
  <p>I followed the following steps. I created the war file. I unzipped it and then added all the spring boot loader class files at its root. I added appropriate entries to the manifest file for making the war executable. Then zipped it and renamed back it back to the original war file. When I executed it with command - Java -jar mywar.war, it failed with the following exception:</p>
  
  <pre><code>java.lang.IllegalStateException: Unable to open nested compressed entry WEB-INF/lib/spring-core-3.1.2.RELEASE.jar
      at org.springframework.boot.loader.jar.JarFile.getNestedJarFileFromFileEntry(JarFile.java:330)
      at org.springframework.boot.loader.jar.JarFile.getNestedJarFile(JarFile.java:305)
      at org.springframework.boot.loader.archive.JarFileArchive.getNestedArchive(JarFileArchive.java:87)
      at org.springframework.boot.loader.archive.JarFileArchive.getNestedArchives(JarFileArchive.java:74)
      at org.springframework.boot.loader.ExecutableArchiveLauncher.getClassPathArchives(ExecutableArchiveLauncher.java:78)
      at org.springframework.boot.loader.Launcher.launch(Launcher.java:52)
      at org.springframework.boot.loader.WarLauncher.main(WarLauncher.java:79)
  </code></pre>
  
  <p>It is giving error not only for specific jar but for all jar files. I guess, it will also fail when I automate the above steps with Maven.</p>
  
  <p>Thanks.</p>