TrackedConditionEvaluator skips loading bean definitions for configuration classes that should not be skipped [SPR-17153] #21690
Labels
in: core
Issues in core modules (aop, beans, core, context, expression)
status: waiting-for-triage
An issue we've not yet triaged or decided on
Anastasiia Smirnova opened SPR-17153 and commented
I've found this issue while using Spring boot and files a ticket to Spring Boot:
spring-projects/spring-boot#14018
Currently we are facing a complex issue with autoconfigurations that are marked with
@EnableScheduling
. I have created sample project that reproduces an issue.It consists of 4 modules:
This module defines
Library0AutoConfiguration
that has@EnableScheduling
and@AutoConfigureBefore(name = "org.library1.Library1AutoConfiguration")
. It will not start because of unsatisfied@ConditionalOnBean
(bean is not present in context).This module defines
Library1AutoConfiguration
that has@AutoConfigureBefore(name = "org.library2.Library2AutoConfiguration")
.This module defines
Library2AutoConfiguration
that has@EnableScheduling
and@Conditional
on bean of typeLibrary1.class
.This module imports:
library-0
,library-1
andlibrary-2
and enables autoconfiguration.There is test
ServiceConfigurationTest
that can be run to reproduce an issue:Actual result: both
Library1AutoConfiguration
andLibrary2AutoConfiguration
should start, because they do not have dependency onLibrary0AutoConfiguration
, but insteadLibrary2AutoConfiguration
will not start and test will fail.Removing@EnableScheduling
fromLibrary0AutoConfiguration
fixes an issue.We have found that
TrackedConditionEvaluator.shouldSkip
fororg.springframework.scheduling.annotation.SchedulingConfiguration
skips loading bean definitions forLibrary2AutoConfiguration
.Spring Boot version 1.5.13
Spring 4.3.17
Issue Links:
The text was updated successfully, but these errors were encountered: