spring报错:Caused by: java.lang.IllegalStateException: Cannot convert value of type for property : no matching editors or conversion strategy found

时间:2024-01-12 17:06:44

原因分析:是因为类返回的类型跟期望的类型没有继承关系,返回的类型就SqlMapClient,它是通过实现了FactoryBean<SqlMapClient>接口的SqlMapClientFactoryBean类的实例方法getObjectType()方法获取的,返回值是SqlMapClient,而期望的类型是SqlMapClientFactoryBean,就通过beans.xml配置的两者肯定不一样

解决方法:去掉实现接口FactoryBean<SqlMapClient>就可以了。