java.lang.IllegalStateException: Cannot convert value of type ‘java.lang.String‘ to required type ‘c
程序员文章站
2024-01-03 18:07:40
...
整合ssm时出现的错误
java.lang.IllegalStateException: Cannot convert value of type ‘java.lang.String’ to required type ‘com.codeyuaiiao.dao.BookMapper’ for property ‘bookMapper’: no matching editors or conversion strategy found
整合ssm时踩过的坑
直接说原因:
<!--2.将我们的所有业务类,注入到Spring,可以通过配置,或者注解实现-->
<bean id="BookServiceImpl" class="com.codeyuaiiao.service.BookServiceImpl">
<!--<property name="bookMapper" value="bookMapper"/>-->
<property name="bookMapper" ref="bookMapper"/>
</bean>
这个地方应该用的是ref而不是value,改成ref即可
这两个属性真的很容易弄混,需要注意!
看到最后的帮忙点个赞???????? 谢谢!
推荐阅读
-
java.lang.IllegalStateException: Cannot convert value of type ‘java.lang.String‘ to required type ‘c
-
Json解析异常Value of type java.lang.String cannot be converted to JSONObject
-
Json解析异常Value of type java.lang.String cannot be converted to JSONObject
-
SpringMVC自定义日期转换器不起作用,报400错误,Failed to convert value of type xxx to required type xxx
-
Failed to convert property value of type [java.lang.String] to required type [java.util.Date]
-
pageHelper 插件报错Caused by: java.lang.IllegalStateException: Cannot convert value of type......
-
maven快速入门番外篇——使用maven整合SSH报错:java.lang.IllegalStateException: Cannot convert value of type...
-
SpringMVC自定义日期转换器不起作用,报400错误,Failed to convert value of type xxx to required type xxx