Does a native Spring Boot app support scheduling ?
A very simple Spring Boot app that has these annotations on it fails to start when it's compiled as a native image using graal.
@SpringBootApplication
@EnableScheduling
@EnableAsync
public class MyApplication {}
The error is as follows:
Invalid declaration of container type [org.springframework.scheduling.annotation.Schedules] for repeatable annotation [org.springframework.scheduling.annotation.Scheduled]; nested exception is java.lang.NoSuchMethodException: No value method found
Spring Boot 2.4.1, org.springframework.experimental:spring-graalvm-native:0.8.4
Compile script as follows (taken from StarBuxman):
native-image \
--verbose \
-H:EnableURLProtocols=http \
-H:+RemoveSaturatedTypeFlows \
-H:Name=$ARTIFACT \
-Dspring.native.verbose=true \
-Dspring.native.remove-jmx-support=true \
-Dspring.native.remove-spel-support=true \
-Dspring.native.remove-yaml-support=true \
-cp $CP $MAINCLASS