Spring和mybatis整合时报出的错误

错误:

Caused by: org.springframework.beans.ConversionNotSupportedException: Failed to convert property value of type 'org.apache.ibatis.session.defaults.DefaultSqlSessionFactory' to required type 'java.lang.String' for property 'sqlSessionFactoryBeanName'; nested exception is java.lang.IllegalStateException: Cannot convert value of type [org.apache.ibatis.session.defaults.DefaultSqlSessionFactory] to required type [java.lang.String] for property 'sqlSessionFactoryBeanName': no matching editors or conversion strategy found


出现错误的原因:



value="sqlSessionFactoryBean"/>

上面property中value修改为了ref,就会报出错误,正确的写法应该是使用value属性

你可能感兴趣的:(Spring)