-
Notifications
You must be signed in to change notification settings - Fork 1.7k
[native-image] Failed to compile spring-boot project to native image (UnsupportedFeatureException) #348
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Comments
Thank you for your report. Spring-boot uses dynamic class loading which is a limitation of SubstrateVM. Sometimes it is possible to avoid dynamic class loading (which might reduce some functionality). I will look into this possibility for spring-boot. |
You can get past this specific error by not using the fat jar launcher as a main method. But there are other bogies lurking. Spring Boot has a static (but optional) dependency on Groovy, for example, so even though it will never be used at runtime, a native-image cannot be built because |
@dsyer can you provide the trace for the |
Sure:
|
is there any other workaround for building native-image for spring boot app, or for now it's blocked w\o any hopes? |
There's no way yet to run a Spring Boot application. Not even the |
Well, GraalVM looks promising for microservices world, since services are getting fat and start time is increasing, which breaks one of the microservices paradigm - fast startup. |
See #507 about the |
I have created SPR-16991 to track SubstrateVM Spring support status. |
More than a week ago Josh Long at the beginning of his Devoxx (devoxx.pl) talk demoed a Spring Boot/Fu app built as a native image using GraalVM: spring-projects-experimental/spring-fu#29 |
@joshlong used the Kotlin sample app from here: spring-projects-experimental/spring-fu#29. There's another minimal Spring app in Java here that works: https://github.com/dsyer/spring-boot-micro-apps (see the instructions in the README). Neither of those apps uses Spring Boot. |
The originally reported issue has been fixed. With the latest release, you can build an image using
It looks like the example app tries to execute a jar which is currently not supported with |
I'm trying to compile a 'simple' spring-boot web project to native image.
Project source:
https://drive.google.com/file/d/136E00Gux6vL3tvcZFM3KgcNuIvtXWlj1/view?usp=sharing
Command:
native-image -jar graal-0.0.1-SNAPSHOT.jar
Log:
The text was updated successfully, but these errors were encountered: