原文:多个@bean无法通过@resource注入对应的bean(org.springframework.beans.factory.NoUniqueBeanDefinitionException: No qualifying bean of type 'javax.sql.DataSource' available: expected single matching bean but found )

一 异常 org.springframework.beans.factory.NoUniqueBeanDefinitionException: No qualifying bean of type javax.sql.DataSource available: expected single matching bean but found : masterDataSource,slaveDataS ...

2019-05-10 12:04 0 5492 推荐指数:

查看详情

Caused by:org.springframework.beans.factory.NoSuchBeanDefinitionException: No qualifying bean of type "" available: expected at least 1 bean which

项目使用spring, mybatis。因为分了多个模块,所以会这个模块引用了其它模块的现在,结果使用Junit测试的时候发现有两个模块不能自动注入dao和service问题。解决后在此记录一下。 解决思路,一直以为是dao的xml文件的配置问题,通过日志查看,发现所有的dao ...

Thu Dec 27 01:21:00 CST 2018 0 1238
 
粤ICP备18138465号  © 2018-2025 CODEPRJ.COM