关于注册失败:expected single matching bean but found 2的问题
敲黑板啦 ? 注入失败,出现如下的错误:Unsatisfied dependency expressed through field 's1'; 和“expected single matching bean but found 2:***,***”你需要加入:@Qualifier(value = "***") 如下:
@Autowired @Qualifier(value = "stringStore") private Store<String> s1; @Autowired @Qualifier(value = "integerStore") private Store<Integer> s2;
奇怪的是老师的没有加Qualifier为什么没有报错?