I don't know when this was introduced but compiling an image with GraalVM 21 lead to the following on startup:
. ____ _ __ _ _
/\\ / ___'_ __ _ _(_)_ __ __ _ \ \ \ \
( ( )\___ | '_ | '_| | '_ \/ _` | \ \ \ \
\\/ ___)| |_)| | | | | || (_| | ) ) ) )
' |____| .__|_| |_|_| |_\__, | / / / /
=========|_|==============|___/=/_/_/_/
:: Spring Boot :: (v4.0.0-M3)
Application run failed
org.springframework.boot.AotInitializerNotFoundException: Startup with AOT mode enabled failed: AOT initializer org.springframework.cloud.task.timestamp.TaskApplication__ApplicationContextInitializer could not be found
at org.springframework.boot.SpringApplication.addAotGeneratedInitializerIfNecessary(SpringApplication.java:428)
at org.springframework.boot.SpringApplication.prepareContext(SpringApplication.java:384)
at org.springframework.boot.SpringApplication.run(SpringApplication.java:319)
at org.springframework.boot.SpringApplication.run(SpringApplication.java:1361)
at org.springframework.boot.SpringApplication.run(SpringApplication.java:1350)
at org.springframework.cloud.task.timestamp.TaskApplication.main(TaskApplication.java:45)
at java.base@21.0.6/java.lang.invoke.LambdaForm$DMH/sa346b79c.invokeStaticInit(LambdaForm$DMH)
The same application starts with GraalVM24. I wonder if we could investigate how to throw a more meaningful exception.
Comment From: snicoll
Chatting with @sdeleuze it is the reflection hints format that isn't understood with older GraalVM versions. We're now considering our option to fail hard as the exception above is a bit confusing.