You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Building an app with AOT enabled and then using extract leads to the following:
Exception in thread "main" java.lang.reflect.InvocationTargetException
at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:77)
at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.base/java.lang.reflect.Method.invoke(Method.java:568)
at org.springframework.boot.loader.launch.Launcher.launch(Launcher.java:91)
at org.springframework.boot.loader.launch.Launcher.launch(Launcher.java:53)
at org.springframework.boot.loader.launch.JarLauncher.main(JarLauncher.java:58)
Caused by: java.lang.IllegalStateException: java.io.UncheckedIOException: java.util.zip.ZipException: duplicate entry: META-INF/native-image/
at org.springframework.boot.jarmode.tools.ToolsJarMode.run(ToolsJarMode.java:56)
at org.springframework.boot.loader.launch.JarModeRunner.main(JarModeRunner.java:43)
... 7 more
Caused by: java.io.UncheckedIOException: java.util.zip.ZipException: duplicate entry: META-INF/native-image/
at org.springframework.boot.jarmode.tools.ExtractCommand.run(ExtractCommand.java:118)
at org.springframework.boot.jarmode.tools.Command.run(Command.java:112)
at org.springframework.boot.jarmode.tools.Runner.runCommand(Runner.java:68)
at org.springframework.boot.jarmode.tools.Runner.run(Runner.java:55)
at org.springframework.boot.jarmode.tools.Runner.run(Runner.java:47)
at org.springframework.boot.jarmode.tools.ToolsJarMode.run(ToolsJarMode.java:53)
... 8 more
Caused by: java.util.zip.ZipException: duplicate entry: META-INF/native-image/
at java.base/java.util.zip.ZipOutputStream.putNextEntry(ZipOutputStream.java:244)
at java.base/java.util.jar.JarOutputStream.putNextEntry(JarOutputStream.java:115)
at org.springframework.boot.jarmode.tools.ExtractCommand.lambda$createApplication$3(ExtractCommand.java:258)
at org.springframework.boot.jarmode.tools.ExtractCommand.withJarEntries(ExtractCommand.java:333)
at org.springframework.boot.jarmode.tools.ExtractCommand.createApplication(ExtractCommand.java:254)
at org.springframework.boot.jarmode.tools.ExtractCommand.run(ExtractCommand.java:114)
... 13 more
This can reproduce build building this sample app with the following command: java -Djarmode=tools -jar build/libs/test-extract-aot-0.0.1-SNAPSHOT.jar extract
The text was updated successfully, but these errors were encountered:
snicoll
changed the title
Extract fails with "duplicate entry: META-INF/native-image/"
Extract jar produced by Gradle plugin fails with "duplicate entry: META-INF/native-image/"
May 25, 2024
mhalbritter
changed the title
Extract jar produced by Gradle plugin fails with "duplicate entry: META-INF/native-image/"
Extract AOT-processed jar produced by Gradle plugin fails with "duplicate entry: META-INF/native-image/"
May 27, 2024
wilkinsona
changed the title
Extract AOT-processed jar produced by Gradle plugin fails with "duplicate entry: META-INF/native-image/"
Extract fails due to a duplicate entry when BOOT-INF/classes contains a directory that's also present in the root of the jar
May 29, 2024
This also fails with Maven if, for example, you have a META-INF/services/… file in src/main/resources. In this case, which also affects Gradle, AOT isn't required for the problem to occur.
Building an app with AOT enabled and then using extract leads to the following:
This can reproduce build building this sample app with the following command:
java -Djarmode=tools -jar build/libs/test-extract-aot-0.0.1-SNAPSHOT.jar extract
The text was updated successfully, but these errors were encountered: