You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
In Sprint Boot 3.5, the injection of the Environment into the factory method of the MethodValidationPostProcessor in ValidationAutoConfiguration produces the non-eligibility warning for beans that contribute to the Environment.
I can reproduce this with 3.5.0-RC1 and also 3.5.0-SNAPSHOT. With 3.4.5, the warnings are not logged.
I don't think the warnings point to a serious issue in this case, but they are confusing to users.
How to reproduce
In the Spring Initializr, build a new project with 3.5.0-RC1 or 3.5.0-SNAPSHOT, and choose
spring-boot-starter-validation
spring-boot-starter-jdbc
Flyway
H2
then the app will log the following warnings on start-up:
2025-05-20T15:31:36.284+02:00 WARN 19501 --- [demo] [ main] trationDelegate$BeanPostProcessorChecker : Bean 'org.springframework.boot.autoconfigure.flyway.FlywayAutoConfiguration' of type [org.springframework.boot.autoconfigure.flyway.FlywayAutoConfiguration] is not eligible for getting processed by all BeanPostProcessors (for example: not eligible for auto-proxying). Is this bean getting eagerly injected/applied to a currently created BeanPostProcessor [methodValidationPostProcessor]? Check the corresponding BeanPostProcessor declaration and its dependencies/advisors. If this bean does not have to be post-processed, declare it with ROLE_INFRASTRUCTURE.
2025-05-20T15:31:36.284+02:00 WARN 19501 --- [demo] [ main] trationDelegate$BeanPostProcessorChecker : Bean 'stringOrNumberMigrationVersionConverter' of type [org.springframework.boot.autoconfigure.flyway.FlywayAutoConfiguration$StringOrNumberToMigrationVersionConverter] is not eligible for getting processed by all BeanPostProcessors (for example: not eligible for auto-proxying). Is this bean getting eagerly injected/applied to a currently created BeanPostProcessor [methodValidationPostProcessor]? Check the corresponding BeanPostProcessor declaration and its dependencies/advisors. If this bean does not have to be post-processed, declare it with ROLE_INFRASTRUCTURE.
Additional info
There are additional warnings when the Spring Cloud Load Balancer is being added and the root cause seems related. But this may be out of scope for this project.
The text was updated successfully, but these errors were encountered:
snicoll
changed the title
Flyway bean not eligible for getting processed by all BeanPostProcessors
ValidationAutoConfiguration triggers early initialization of properties binding
May 20, 2025
Uh oh!
There was an error while loading. Please reload this page.
Summary
In Sprint Boot 3.5, the injection of the
Environment
into the factory method of theMethodValidationPostProcessor
inValidationAutoConfiguration
produces the non-eligibility warning for beans that contribute to theEnvironment
.I can reproduce this with 3.5.0-RC1 and also 3.5.0-SNAPSHOT. With 3.4.5, the warnings are not logged.
I don't think the warnings point to a serious issue in this case, but they are confusing to users.
How to reproduce
In the Spring Initializr, build a new project with 3.5.0-RC1 or 3.5.0-SNAPSHOT, and choose
spring-boot-starter-validation
spring-boot-starter-jdbc
then the app will log the following warnings on start-up:
Additional info
There are additional warnings when the Spring Cloud Load Balancer is being added and the root cause seems related. But this may be out of scope for this project.
The text was updated successfully, but these errors were encountered: