您的位置:首页 > 编程语言 > Java开发

Spring+mybatis+SpringMVC整合发生异常:org.springframework.beans.ConversionNotSupportedException

2017-08-28 16:06 656 查看
错误:

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

原因:

<property name="sqlSessionFactoryBeanName" ref="sqlSessionFactoryBean"/>

解决:

<bean class="org.mybatis.spring.mapper.MapperScannerConfigurer">

<!-- 会话工厂 -->

<property name="sqlSessionFactoryBeanName"  value="sqlSessionFactoryBean"/>

将property中ref修改为了value,正确的写法应该是使用value属性!



顶2
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: 
相关文章推荐