'java.lang.String' to required type 'javax.sql.DataSource' for property 'dataSource'

'java.lang.String' to required type 'javax.sql.DataSource' for property 'dataSource'

在配置spring环境时出现如上错误,即类型不匹配不能够完成字符串类型到dataSource对象的转换

错误原因

spring的applicationContext.xml文件中,在配置sqlSessionFactory和在配置事务的时候

> 将ref注入错写为value注入
原文地址:https://www.cnblogs.com/xshun/p/12309719.html