You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Revisit @Configuration(proxyBeanMethods = false) with qualified injection points #23887
We've switched DelegatingWebMvcConfiguration to disable method proxying and there are a number of side effects that aren't currently covered.
requestMappingHandlerAdapter takes a mvcContentNegotiationManager, mvcConversionService and mvcValidator. These are "qualified" in the aim of calling the related method on the same class.
The problem with this approach is that if any of those types are already exposed with a @Primary bean, the context will not even attempt to look for a candidate (and therefore will not invoke the dedicated bean factory method if necessary).
A concrete illustration of this problem for mvcConverter can be found in spring-projects/spring-boot#18672. A fix is to add a @Qualifier to teach the context the qualified bean is actually required and the context should attempt to look it up.
This seems to be working as expected (although with more metadata than it should be ideally) but given that no tests broke, I can only assume this use case isn't covered by tests at the moment. The purpose of this issue is to revisit this support, add missing tests and eventually change our mind with regards to this decision.
changed the title [-]MVC configuration may not use expected infrastructure[/-][+]Revisit @Configuration(proxyBeanMethods = false) with qualified injection points[/+]on Oct 30, 2019
This turned out to be a larger affair. Checking our use of @Configuration(proxyBeanMethods = false) when the injection point expect a qualified injection point. Production code seems rather limited at the moment:
Activity
[-]MVC configuration may not use expected infrastructure[/-][+]Revisit @Configuration(proxyBeanMethods = false) with qualified injection points[/+]snicoll commentedon Oct 30, 2019
This turned out to be a larger affair. Checking our use of
@Configuration(proxyBeanMethods = false)when the injection point expect a qualified injection point. Production code seems rather limited at the moment:ProxyTransactionManagementConfigurationDelegatingWebMvcConfigurationDelegatingWebFluxConfigurationMake sure Web infrastructure uses qualified beans
Add qualified injection points for MVC and WebFlux infrastructure
Add qualified injection points for MVC and WebFlux infrastructure