-
Notifications
You must be signed in to change notification settings - Fork 1.6k
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
Build time initialization of org.springframework.http.HttpStatus
#4673
Comments
org.springframework.http.HttpStatus
As spring-projectsgh-28624 supports only static boolean fields, we still need a few classes to be initialized at build time. Such explicit configuration should be in theory avoidable, so we will work with the GraalVM team to see if this can be fixed, see for example oracle/graal#4673 for HttpStatus. See spring-projectsgh-28624
If that can help, the related JAR can be found in https://search.maven.org/artifact/org.springframework/spring-web. |
Thank you for reporting this, We will take a look into this and get back to you if needed. |
@sdeleuze can you please check if the problem is still reproducible (with the latest daily build of GraalVM, as well as with GraalVM 22.2). The call to |
I confirm it works out of the box with GraalVM 22.2 and latest dev build without any |
See oracle/graal#4673 related issue. Closes spring-projectsgh-29018
Thanks for confirming that it works now! |
Since the introduction of Spring mechanism to make some fields constant at build time without having to use class build-time initialization (see this commit),
org.springframework.http.HttpStatus
(sources) is one of the few remaining Spring Framework class that requires build time initialization.I suspect this is a GraalVM bug that could be fixed like done for
DataSize
. I suspect it is caused by this line that is not detected as safe by GraalVM so it requires manual build-time init which is unfortunate and something we would like to avoid.Could you please check if that's fixable on your side (warning : for now, I will bring back a
META-INF/native-image/org.springframework/spring-web/native-image.properties
withArgs = --initialize-at-build-time=org.springframework.http.HttpStatus
so make sure to remove it to reproduce. Maybe just copyHttpStatus.java
source code since it is pretty isolated.Please tag this issue with the
spring
label.Please find the stacktrace below:
The text was updated successfully, but these errors were encountered: