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
踩
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
踩
相关文章推荐
- SSM 运行时发生异常:org.springframework.beans.ConversionNotSupportedException:
- Spring 整合 Flex (BlazeDS)无法从as对象 到 Java对象转换的异常:org.springframework.beans.ConversionNotSupportedException: Failed to convert property value of type 'java.util.Date' to required type 'java.sql.Timestamp' for property 'wfsj'; nested exception is java.lang.Ill
- org.springframework.beans.ConversionNotSupportedException异常解决方法
- Spring 整合 Flex (BlazeDS)无法从as对象 到 Java对象转换的异常:org.springframework.beans.ConversionNotSupportedExcept
- java异常:org.springframework.beans.ConversionNotSupportedException
- org.springframework.beans.ConversionNotSupportedException
- org.springframework.beans.ConversionNotSupportedException: Failed to convert value of type 'java.la
- org.springframework.beans.ConversionNotSupportedException:
- 在Spring Cloud框架整合微服务时出现的org.springframework.web.HttpMediaTypeNotSupportedException异常问题
- nested exception is org.springframework.beans.ConversionNotSupportedException的解决方法
- SpringMVC+Mybatis+Spring整合中org.springframework.beans.factory.BeanCreationException错误分析
- 解决[BlazeDS]Error deserializing client message. org.springframework.beans.ConversionNotSupportedExcep
- mybatis配置通用dao和service时出现org.springframework.beans.factory.BeanCreationException异常
- Spring-Struts2整合异常:java.lang.ClassNotFoundException: org.springframework.web.context.ContextLoaderLi
- SH初步整合的异常:org.springframework.beans.factory.BeanCreationException
- spring异常解决方法:org.springframework.beans.factory.BeanCreationNotAllowedException
- 异常:java.lang.ClassNotFoundException: org.springframework.web.servlet.Dispatcher
- Spring+Mybatis 查询所有数据时发生异常:org.apache.ibatis.reflection.ReflectionException: There is no getter for
- nested exception is org.springframework.beans.NotWritablePropertyException:
- Error setting property values; nested exception is org.springframework.beans.NotWritablePropertyExce