Spring JavaConfig - NoSuchBeanDefinitionException: No unique bean of type
来源:互联网 发布:梦幻西游数据号 编辑:程序博客网 时间:2024/06/03 06:00
原报错代码:Service中定义
@Autowired
private TestDao testDao;
TestDao定义如下
@Repository
public interface TestDao {
public void say();
}
TestDao实现定义:
@Repository
public class TestDaoImpl2 implements TestDao {
@Override
public void say() {
System.out.println("2222222222222222222222222222222222222222222222");
}
}
@Repository
public class TestDaoImpl3 implements TestDao {
@Override
public void say() {
System.out.println("333333333333333333333333333333333333333333333333333333333333");
}
}
改后的Service
@Autowired
@Qualifier("testDaoImpl2")
private TestDao testDao2;
@Autowired
@Qualifier("testDaoImpl3")
private TestDao testDao3;
- Spring JavaConfig - NoSuchBeanDefinitionException: No unique bean of type
- Spring的JUnit错误:NoSuchBeanDefinitionException: No unique bean of type,expected single matching bean but found 2 [dataSource1,data
- spring exception--No unique bean of type
- Spring注解No unique bean of type
- NoSuchBeanDefinitionException: No qualifying bean of type
- NoSuchBeanDefinitionException:No qualifying bean of type 解决方法
- Caused by: org.springframework.beans.factory.NoSuchBeanDefinitionException: No unique bean of type [
- org.springframework.beans.factory.NoSuchBeanDefinitionException: No unique bean of type [com.yuanv.b
- No unique bean of type
- No unique bean of type
- Bean对象注入失败 .NoSuchBeanDefinitionException: No qualifying bean of type..
- NoSuchBeanDefinitionException: No qualifying bean of type 错误误区
- org.springframework.beans.factory.NoSuchBeanDefinitionException: No matching bean of type
- org.springframework.beans.factory.NoSuchBeanDefinitionException: No qualifying bean of type
- BeanCreationException: No unique bean of type
- BeanCreationException: No unique bean of type
- paip . 解决spring No unique bean of type [com.mijie.homi.search.service.index.MoodUserIndexService]
- spring 依赖注入用@Autowired报错 No unique bean of type
- SQL注入于防御
- myeclipse不编译解决方法
- windows mobile 6.5 隐藏 左下角(左上角)的开始按钮 叉号关闭按钮
- jira配置
- 暑假小结
- Spring JavaConfig - NoSuchBeanDefinitionException: No unique bean of type
- 本文介绍如何实现位图与文字的合成并保存为位图文件
- 【解题报告】HDU 4679 Terrorist’s destroy -- 树形dp 删一边求两子树直径
- hdu 3015 Disharmony Trees
- bmp图片和jpg图片之间的相互转换(OpenCV)
- layout_gravity和gravity的用法
- IOS中获取各种文件的目录路径的方法
- poj-1013 Counterfeit Dollar
- PAT知识点(C++)