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
@Scheduled method not triggered when spring.main.lazy-initialization=true #25315
Comments
I've edited your comment to improve the formatting. You might want to check out this Mastering Markdown guide for future reference. |
Moving it back to Spring Boot as @wilkinsona reminded me we have dedicated logic in other areas to prevent that from happening. |
A general-purpose fix for this would require us to mimic some of the logic in @arikanorh While we're deciding what to do, you should be able to work around the problem with one or more @Bean
LazyInitializationExcludeFilter lazyInitializationExcludeFilter() {
return LazyInitializationExcludeFilter.forBeanTypes(TypeWithScheduledMethods.class);
} |
There are two issues here. The filtering we've described above and the fact our |
Spring Boot Version: 2.4.2
Spring Framework Version: 5.3.3
@EnableScheduling
@Component
with a@Scheduled
methodspring.main.lazy-initialization=true
toapplication.properties
The method is never called.
The text was updated successfully, but these errors were encountered: