spring-graalvm-native-plugin icon indicating copy to clipboard operation
spring-graalvm-native-plugin copied to clipboard

Executable Spring Boot archives are not supported (Unexpected record signature: 0X622F2123)

Open vitalyster opened this issue 5 years ago • 5 comments

Things to check before reporting a bug

Describe the bug

build failed with error message above

To Reproduce Add to build.gradle:

bootJar {
    launchScript()
}

Expected behavior

buildNativeImage task should build image

vitalyster avatar Dec 09 '20 08:12 vitalyster

The error message means the JAR file generated by bootJar is not a valid/standard zip file. Can you share a simple test repository that I can use to reproduce the error locally?

ayltai avatar Dec 09 '20 08:12 ayltai

Just add launchScript() to bootJar configuration of any Spring Boot application and Spring Boot will repackage jar with executable script, see https://docs.spring.io/spring-boot/docs/current/gradle-plugin/reference/htmlsingle/#packaging-executable-configuring-launch-script

vitalyster avatar Dec 09 '20 09:12 vitalyster

RIght, on the documentation it says "Currently, some tools do not accept this format so you may not always be able to use this technique" so apparently the JAR file generated is not supported by this plugin which uses Java API to extract the contents from the JAR file.

Why do you want to produce an executable JAR while at the end you want a native image?

ayltai avatar Dec 09 '20 09:12 ayltai

@ayltai I just follow guide to enable native image plugin and see this error. If it is too much work to add support for this non-standard jar then guide should mention that option and ask user to remove it

vitalyster avatar Dec 09 '20 09:12 vitalyster

Good point. I wasn't aware of that. Thanks

ayltai avatar Dec 09 '20 09:12 ayltai