I have a download application and on one of my facades I try Autowire conversionService as follows:
@Autowired private ConversionService conversionService;
As a result, I get the following:
Caused by: org.springframework.beans.factory.NoUniqueBeanDefinitionException: No qualifying bean of type [org.springframework.core.convert.ConversionService] is defined: expected single matching bean but found 3: mvcConversionService,defaultConversionService,integrationConversionService at org.springframework.beans.factory.support.DefaultListableBeanFactory.doResolveDependency(DefaultListableBeanFactory.java:1061) at org.springframework.beans.factory.support.DefaultListableBeanFactory.resolveDependency(DefaultListableBeanFactory.java:949) at org.springframework.beans.factory.annotation.AutowiredAnnotationBeanPostProcessor$AutowiredFieldElement.inject(AutowiredAnnotationBeanPostProcessor.java:533) ... 16 more
To overcome this, I added the lilke classifier:
@Autowired @Qualifier("mvcConversionService") private ConversionService c;
and it all works. However, all of my custom converters are automatically added to the mvcConversionService . And now I want to extend the conversionService and add another method to it, however my converters are again added to the mvcConversionService . Is there a way to tell spring-boot which conversionService use to automatically register my converters there? I do not want to manually list all the converters in the new conversionService .
source share