Creating a MethodValidationPostProcessor bean in SpringBoot application results in a
Bean '...' of type [...] is not eligible for getting processed by all BeanPostProcessors (for example: not eligible for auto-proxying)
message in the log.
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
import org.springframework.validation.beanvalidation.MethodValidationPostProcessor;
@SpringBootApplication
public class DemoApplication {
public static void main(String[] args) {
SpringApplication.run(DemoApplication.class, args);
}
@Configuration
static class MethodValidationPostProcessorConfiguration {
@Bean
public MethodValidationPostProcessor methodValidationPostProcessor() {
return new MethodValidationPostProcessor();
}
}
}
Here is a sample project which demonstrates the problem.
I've checked few questions and answers on this warning:
Tracking down cause of Spring's "not eligible for auto-proxying"
Class not eligible for getting processed by all BeanPostProcessors
spring security not eligible for auto-proxying
And these articles:
Bean X of type Y is not eligible for getting processed by all BeanPostProcessors
Solving Spring’s “not eligible for auto-proxying” Warning
But I'm still not sure how these apply to the MethodValidationPostProcessor bean case.
- Is the warning in this particular case pointing to a real issue?
- If it is, how can it be solved? For example using
@Lazyon the bean has no effect.
Thank you for reading