报错信息:Unsatisfied dependency expressed through bean property 'sqlSessionFactory'; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'org.mybatis.spring.SqlSessionFactoryBean#0' defined in class path resource [spring.xml]: Initialization of bean failed; nested exception is org.springframework.beans.ConversionNotSupportedException: Failed to convert property value of type 'java.lang.String' to required type 'javax.sql.DataSource' for property 'dataSource'; nested exception is java.lang.IllegalStateException: Cannot convert value of type 'java.lang.String' to required type 'javax.sql.DataSource' for property 'dataSource': no matching editors or conversion strategy found at org.springframework.beans.factory.annotation.AutowiredAnnotationBeanPostProcessor$AutowiredFieldElement.inject
加粗的为重点
然后找到spring.xml 发现
![](https://i-blog.csdnimg.cn/blog_migrate/a842915b95b829399cf70c6e2f61dfe7.png)
这里应该改成ref才对
![](https://i-blog.csdnimg.cn/blog_migrate/b800c04b801739fa3c084c052f3a8566.png)
问题成功解决