Exception encountered during context initialization - cancelling refresh attempt: org.springframewor

在Spring框架上下文初始化期间遇到异常,导致刷新尝试取消。具体问题为Bean 'BookServiceImpl'创建时失败,主要是由于试图将String类型的属性值转换为所需的BookMapper类型失败,这是一个非法状态异常,提示将value改为ref。
摘要由CSDN通过智能技术生成

Exception encountered during context initialization - cancelling refresh attempt: org.springframework.beans.factory.BeanCreationException: Error creating bean with name ‘BookServiceImpl’ defined in class path resource [spring-service.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 ‘com.kuang.dao.BookMapper’ for property ‘bookMapper’; nested exception is java.lang.IllegalStateException:


报错信息 说无法将 String 注入到 bookMapper 中, 原因就是本身是对象, 结果注入的时候用的value
    <!-- 将所有业务类注入到Spring, 可以通过 配置 / 注解实现   -->
    <bean id=
  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值