no matching editors or conversion strategy found 异常_解决办法
来源:互联网 发布:我知你好未再百度 编辑:程序博客网 时间:2024/05/16 07:30
这次在模仿用原始Dao方式编写代码时,测试出现这个错误,困扰了我好久,终于找到原因了。
原因:
解决办法:把value属性纠正为ref后,就可以正常创建bean对象,输出查询结果
总结:经验不足,以后多注意!
org.springframework.beans.factory.BeanCreationException: Error creating bean with name ‘userDao’ defined in class path resource [spring/applicationContext.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 ‘org.apache.ibatis.session.SqlSessionFactory’ for property ‘sqlSessionFactory’; nested exception is java.lang.IllegalStateException: Cannot convert value of type [java.lang.String] to required type [org.apache.ibatis.session.SqlSessionFactory] for property ‘sqlSessionFactory’: no matching editors or conversion strategy found
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:532)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:461)
at org.springframework.beans.factory.support.AbstractBeanFactory
at org.junit.internal.runners.model.ReflectiveCallable.run(ReflectiveCallable.java:15)
at org.junit.runners.model.FrameworkMethod.invokeExplosively(FrameworkMethod.java:41)
at org.junit.internal.runners.statements.RunBefores.evaluate(RunBefores.java:27)
at org.junit.runners.ParentRunner.runLeaf(ParentRunner.java:263)
at org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit4ClassRunner.java:69)
at org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit4ClassRunner.java:48)
at org.junit.runners.ParentRunner
at org.junit.runners.ParentRunner.runChildren(ParentRunner.java:229)
at org.junit.runners.ParentRunner.access
at org.junit.runners.ParentRunner.run(ParentRunner.java:292)
at org.eclipse.jdt.internal.junit4.runner.JUnit4TestReference.run(JUnit4TestReference.java:86)
at org.eclipse.jdt.internal.junit.runner.TestExecution.run(TestExecution.java:38)
at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner.java:459)
at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner.java:678)
at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.run(RemoteTestRunner.java:382)
at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.main(RemoteTestRunner.java:192)
Caused by: org.springframework.beans.ConversionNotSupportedException: Failed to convert property value of type ‘java.lang.String’ to required type ‘org.apache.ibatis.session.SqlSessionFactory’ for property ‘sqlSessionFactory’; nested exception is java.lang.IllegalStateException: Cannot convert value of type [java.lang.String] to required type [org.apache.ibatis.session.SqlSessionFactory] for property ‘sqlSessionFactory’: no matching editors or conversion strategy found
at org.springframework.beans.BeanWrapperImpl.convertIfNecessary(BeanWrapperImpl.java:465)
at org.springframework.beans.BeanWrapperImpl.convertForProperty(BeanWrapperImpl.java:496)
at org.springframework.beans.BeanWrapperImpl.convertForProperty(BeanWrapperImpl.java:490)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.convertForProperty(AbstractAutowireCapableBeanFactory.java:1437)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.applyPropertyValues(AbstractAutowireCapableBeanFactory.java:1396)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.populateBean(AbstractAutowireCapableBeanFactory.java:1132)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:522)
… 34 more
Caused by: java.lang.IllegalStateException: Cannot convert value of type [java.lang.String] to required type [org.apache.ibatis.session.SqlSessionFactory] for property ‘sqlSessionFactory’: no matching editors or conversion strategy found
at org.springframework.beans.TypeConverterDelegate.convertIfNecessary(TypeConverterDelegate.java:264)
at org.springframework.beans.BeanWrapperImpl.convertIfNecessary(BeanWrapperImpl.java:450)
… 40 more
- no matching editors or conversion strategy found 异常_解决办法
- no matching editors or conversion strategy found 异常
- no matching editors or conversion strategy found 的解决办法
- no matching editors or conversion strategy found
- no matching editors or conversion strategy found
- no matching editors or conversion strategy found
- no matching editors or conversion strategy found
- no matching editors or conversion strategy found
- No Matching editors or conversion strategy found
- spring报no matching editors or conversion strategy found
- 解决: Spring no matching editors or conversion strategy found
- 项目中遇到 no matching editors or conversion strategy found
- spring配置 no matching editors or conversion strategy found 异常解决方案
- spring配置 no matching editors or conversion strategy found 异常解决方案
- spring java.lang.IllegalArgumentException:。。。 no matching editors or conversion strategy found异常
- spring配置 no matching editors or conversion strategy found 异常解决方案
- 自定义类型转换器出错:no matching editors or conversion strategy found
- Spring中的报错:no matching editors or conversion strategy found
- hdu 2336 无题II 【二分+二分匹配】
- 链表删除指定的值
- 创建版本库
- 卸载豌豆荚后显示devices not found
- Python实现加解密
- no matching editors or conversion strategy found 异常_解决办法
- linux驱动参数及参数的设置及修改
- listview scrollview 头部下拉放大效果
- 热部署
- Android URLEncoder
- 全排列散列,康拓展开
- python i++ ,python有这种语法吗?类似C++和java的 i++。整数自增
- 稳定排序和不稳定排序
- Shell字符串比较相等、不相等方法小结