{"action":"closed","issue":{"url":"https://api.github.com/repos/spring-projects/spring-boot/issues/6630","repository_url":"https://api.github.com/repos/spring-projects/spring-boot","labels_url":"https://api.github.com/repos/spring-projects/spring-boot/issues/6630/labels{/name}","comments_url":"https://api.github.com/repos/spring-projects/spring-boot/issues/6630/comments","events_url":"https://api.github.com/repos/spring-projects/spring-boot/issues/6630/events","html_url":"https://github.com/spring-projects/spring-boot/issues/6630","id":170822645,"number":6630,"title":"java.util.zip.ZipException when running Files.walk on /BOOT-INF/classes","user":{"login":"semeiser","id":107039,"avatar_url":"https://avatars.githubusercontent.com/u/107039?v=3","gravatar_id":"","url":"https://api.github.com/users/semeiser","html_url":"https://github.com/semeiser","followers_url":"https://api.github.com/users/semeiser/followers","following_url":"https://api.github.com/users/semeiser/following{/other_user}","gists_url":"https://api.github.com/users/semeiser/gists{/gist_id}","starred_url":"https://api.github.com/users/semeiser/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/semeiser/subscriptions","organizations_url":"https://api.github.com/users/semeiser/orgs","repos_url":"https://api.github.com/users/semeiser/repos","events_url":"https://api.github.com/users/semeiser/events{/privacy}","received_events_url":"https://api.github.com/users/semeiser/received_events","type":"User","site_admin":false},"labels":[],"state":"closed","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":9,"created_at":"2016-08-12T08:28:35Z","updated_at":"2016-08-12T12:27:48Z","closed_at":"2016-08-12T12:27:48Z","body":"Hello,\r\n\r\nwe're getting the following Exception when trying to do a Files.walk on the /BOOT-INF/classes directory in an executable jar on Sping Boot 1.4.0:\r\n```\r\nException in thread \"main\" java.lang.reflect.InvocationTargetException\r\n\tat sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)\r\n\tat sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)\r\n\tat sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)\r\n\tat java.lang.reflect.Method.invoke(Method.java:497)\r\n\tat org.springframework.boot.loader.MainMethodRunner.run(MainMethodRunner.java:48)\r\n\tat org.springframework.boot.loader.Launcher.launch(Launcher.java:87)\r\n\tat org.springframework.boot.loader.Launcher.launch(Launcher.java:50)\r\n\tat org.springframework.boot.loader.JarLauncher.main(JarLauncher.java:58)\r\nCaused by: java.io.UncheckedIOException: java.util.zip.ZipException: loc: wrong sig ->20746168\r\n\tat java.nio.file.FileTreeIterator.fetchNextIfNeeded(FileTreeIterator.java:88)\r\n\tat java.nio.file.FileTreeIterator.hasNext(FileTreeIterator.java:104)\r\n\tat java.util.Iterator.forEachRemaining(Iterator.java:115)\r\n\tat java.util.Spliterators$IteratorSpliterator.forEachRemaining(Spliterators.java:1801)\r\n\tat java.util.stream.AbstractPipeline.copyInto(AbstractPipeline.java:481)\r\n\tat java.util.stream.AbstractPipeline.wrapAndCopyInto(AbstractPipeline.java:471)\r\n\tat java.util.stream.ForEachOps$ForEachOp.evaluateSequential(ForEachOps.java:151)\r\n\tat java.util.stream.ForEachOps$ForEachOp$OfRef.evaluateSequential(ForEachOps.java:174)\r\n\tat java.util.stream.AbstractPipeline.evaluate(AbstractPipeline.java:234)\r\n\tat java.util.stream.ReferencePipeline.forEach(ReferencePipeline.java:418)\r\n\tat com.example.FilesWalkJarExceptionApplication.main(FilesWalkJarExceptionApplication.java:17)\r\n\t... 8 more\r\nCaused by: java.util.zip.ZipException: loc: wrong sig ->20746168\r\n\tat com.sun.nio.zipfs.ZipFileSystem$Entry.readExtra(ZipFileSystem.java:2277)\r\n\tat com.sun.nio.zipfs.ZipFileSystem$Entry.cen(ZipFileSystem.java:1903)\r\n\tat com.sun.nio.zipfs.ZipFileSystem$Entry.readCEN(ZipFileSystem.java:1871)\r\n\tat com.sun.nio.zipfs.ZipFileSystem.getEntry0(ZipFileSystem.java:1329)\r\n\tat com.sun.nio.zipfs.ZipFileSystem.getFileAttributes(ZipFileSystem.java:317)\r\n\tat com.sun.nio.zipfs.ZipPath.getAttributes(ZipPath.java:664)\r\n\tat com.sun.nio.zipfs.ZipFileSystemProvider.readAttributes(ZipFileSystemProvider.java:294)\r\n\tat java.nio.file.Files.readAttributes(Files.java:1737)\r\n\tat java.nio.file.FileTreeWalker.getAttributes(FileTreeWalker.java:219)\r\n\tat java.nio.file.FileTreeWalker.visit(FileTreeWalker.java:276)\r\n\tat java.nio.file.FileTreeWalker.next(FileTreeWalker.java:372)\r\n\tat java.nio.file.FileTreeIterator.fetchNextIfNeeded(FileTreeIterator.java:84)\r\n\t... 18 more\r\n```\r\nThe same code works with Spring Boot 1.3.X and the error only appears with an executable jar, non-executable jar works fine. Also /BOOT-INF/lib and /org/... directories can be traversed. A stripped down example can be found here https://github.com/semeiser/spring-boot-14-jarexception.\r\n\r\nThe original intent of the code is to recursivly walk down a resource directory, filter the entries and get the path from the resource root for every entry. The solution with Files.walk might be a bit naive, so if you can point me in a better direction I'll gladly change the code. But as the code worked with the previous versions of Spring Boot I thought I'd report it."}}
{"actor":{"display_login":"wilkinsona"}}