SpringMVC 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

报这个异常原因

<bean class="org.mybatis.spring.mapper.MapperScannerConfigurer"> 中 sqlSessionFactoryBeanName 的属性应该用value,容易写成ref

错误写法:

正确写法:

原文地址:https://www.cnblogs.com/miniDog/p/10582617.html