Skip to content

Reference documentation sample for MethodValidationPostProcessor is missing a static keyword #32929

Closed
@ozooxo

Description

@ozooxo

I followed the Spring official document to define MethodValidationPostProcessor for bean validation. But I am triggering the below warning:

2024-05-30T17:53:41.988-04:00 WARN 74724 --- [demo] [ main] trationDelegate$BeanPostProcessorChecker : Bean 'appConfig' of type [com.example.demo.AppConfig$$SpringCGLIB$$0] is not eligible for getting processed by all BeanPostProcessors (for example: not eligible for auto-proxying). The currently created BeanPostProcessor [validationPostProcessor] is declared through a non-static factory method on that class; consider declaring it as static instead.

To reproduce it, see https://github.com/ozooxo/spring-jakarta-validation-post-processors-warning

  • Commit #1 is solely generated by spring starter.
  • Commit #2 defines the MethodValidationPostProcessor bean following the doc.

then if I ./gradlew bootRun I'll see the above warning.

It seems that a similar problem has been coming up before in ~2017:

but it has been coming back.

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions