问答详情
源自:4-7 mybatis整合Spring编码

测试的时候报错

警告: Exception encountered during context initialization - cancelling refresh attempt
org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'sqlSessionFactory' defined in class path resource [spring/spring-dao.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

提问者:慕UI6755243 2017-11-04 23:41

个回答

  • weixin_慕标9025388
    2019-05-23 12:15:59

    +1...求救

  • hermi0ne
    2017-11-05 10:18:35

    你应该是写错了,应该是<property name="dataSource" ref="dataSource"/>,你检查检查是不是写成了<property name="dataSource" value="dataSource"/>