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=