标签:实现 选择 one ring primary 注解 except beans single
当一个接口有两个实现类时,并两个实现类都被 Spring
管理,则需要对某个类进行 @Primary
注解,表示优先选择此实现类。
否则会抛出 异常
org.springframework.beans.factory.NoUniqueBeanDefinitionException: No qualifying bean of type [main.service.Singer] is defined: expected single matching bean but found 2...
标签:实现 选择 one ring primary 注解 except beans single
原文地址:https://www.cnblogs.com/dadiwm321/p/12303284.html