Closed
Description
Harald Radi opened SPR-14822 and commented
WebMvcConfigurationSupport.mvcConversionService() creates a non-overrideable DefaultFormattingConversionService which scans for all Converter-beans. If one of those beans happens to be advised an IllegalArgumentException is thrown, since GenericConversionService.getRequiredTypeInfo() tries to derive the type info from the Proxy that only contains the type erasures and not the actual types.
Adding a proxy check and deriving the type info from the proxy-target would resolve that issue.
org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'mvcConversionService' defined in class path resource [org/springframework/boot/autoconfigure/web/WebMvcAutoConfiguration$EnableWebMvcConfiguration.class]: Bean instantiation via factory method failed; nested exception is org.springframework.beans.BeanInstantiationException: Failed to instantiate [org.springframework.format.support.FormattingConversionService]: Factory method 'mvcConversionService' threw exception; nested exception is java.lang.IllegalArgumentException: Unable to the determine sourceType <S> and targetType <T> which your Converter<S, T> converts between; declare these generic types.
Affects: 4.3.3
Issue Links:
- AnnotationAwareOrderComparator getPriority does not work if bean is a proxy [SPR-13884] #18457 AnnotationAwareOrderComparator getPriority does not work if bean is a proxy
- ConversionService performance regression [SPR-14929] #19496 ConversionService performance regression