0

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

Bean 'advisor' of type [org.springframework.aop.support.DefaultPointcutAdvisor] is 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.


  1. Is the warning in this particular case pointing to a real issue?
  2. If it is, how can it be solved? For example using @Lazy on the bean has no effect.

Thank you for reading

MartinBG
  • 1,247
  • 10
  • 17

0 Answers0