问题:
这是我报错的信息
org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'sqlSessionFactory' defined in
file [E:\IDEA-workspace\SSM\ParentMaven\Web\target\Web\WEB-INF\classes\spring\spring-context.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
解决办法
其实只是自己粗心,在配置 sqlSession 时没有引用数据源,将 value 改为 ref 就好了