Skip to content

ValidationAutoConfiguration triggers early initialization of properties binding #45618

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

Closed
hpoettker opened this issue May 20, 2025 · 3 comments
Closed
Assignees
Labels
type: regression A regression from a previous release
Milestone

Comments

@hpoettker
Copy link
Contributor

hpoettker commented May 20, 2025

Summary

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.

@spring-projects-issues spring-projects-issues added the status: waiting-for-triage An issue we've not yet triaged label May 20, 2025
@snicoll
Copy link
Member

snicoll commented May 20, 2025

Thanks for the report, I can reproduce as described.

@snicoll
Copy link
Member

snicoll commented May 20, 2025

This is a regression that has been introduced by #43886

@snicoll snicoll added type: regression A regression from a previous release and removed status: waiting-for-triage An issue we've not yet triaged labels May 20, 2025
@snicoll snicoll added this to the 3.5.0 milestone May 20, 2025
@snicoll snicoll changed the title Flyway bean not eligible for getting processed by all BeanPostProcessors ValidationAutoConfiguration triggers early initialization of properties binding May 20, 2025
@snicoll snicoll self-assigned this May 20, 2025
@hpoettker
Copy link
Contributor Author

Thanks for the very quick fix!

With the new snapshots, also the warnings that were logged for the Spring Cloud Load Balancer, which I mentioned above, are resolved.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
type: regression A regression from a previous release
Projects
None yet
Development

No branches or pull requests

3 participants