Join GitHub today
GitHub is home to over 50 million developers working together to host and review code, manage projects, and build software together.Sign up
Warn about non-static BeanDefinitionRegistryPostProcessor declarations on @Configuration classes [SPR-14234] #18808
When you implement the BeanDefinitionRegistryPostProcessor interface on your
This was found when using the AnnotationConfigWebApplicationContext contextClass in a Tomcat WAR. We initially saw it with Spring 3.2.8, but it still seems to be a problem in 4.2.5.
This breaks the following behavior described in the documentation:
Instead, fooRepository() in this example will end up running multiple times because the bean instance is the actual
Either this should work as documented (which could be a breaking change if anyone was depending on this particular bug invoking methods in
Juergen Hoeller commented
As far as I can see, this is an unpleasant but known and accepted side effect:
We need to document this more clearly and should consider warn log entries for any such post-processor definitions.against instance-based factory methods. I'll revisit this for 4.3 RC2.