Cannot convert value of type [java.lang.String] to required type [javax.sql.DataSource] for property 'dataSource': no matching e

来源:互联网 发布:江苏省高考报名端口 编辑:程序博客网 时间:2024/09/21 09:28

无法将你的datasource里配置的字符串转换成javax.sql.DataSource对象,导致SessionFactory无法完成,datasource配置肯定有误,检查[/WEB-INF/applicationContext.xml]文件中的datasource相关的配置。或者贴出来让大家看看。
<property name="dataSource" value="dataSource">
配置错了,这写法Spring会以字符串方式注入,报类型不匹配异常,改为
<property name="dataSource" ref="dataSource"/>