0
点赞
收藏
分享

微信扫一扫

org.springframework.beans.factory.CannotLoadBeanClassException: Cannot find class [com.mzf.service.I

alonwang 2022-04-13 阅读 40

org.springframework.beans.factory.CannotLoadBeanClassException: Cannot find class [com.mzf.service.Impl.BooksServiceImpl] for bean with name 'booksServiceImpl' defined in class path resource [spring-service.xml]; nested exception is java.lang.ClassNotFoundException: com.mzf.service.Impl.BooksServiceImpl
org.springframework.beans.factory.CannotLoadBeanClassException:无法找到[com.mzf.service.Impl.BooksServiceImpl]对于在类路径 resource [ spring - service . xml ]中定义了名称为“ books Service I mpl ”的 be an ,嵌套异常为java.lang.ClassNotFoundException:com.mzf.service.Impl.BooksServiceImpl

解决办法:

1.注释掉BooksServiceImpl的声明

<!--<bean id="booksServiceImpl" class="com.mzf.service.Impl.BooksServiceImpl">
    <property name="booksDao" ref="booksDao"></property>
</bean>-->

 

2.在BooksServiceImpl类上加入注解@Service

 

 

举报

相关推荐

0 条评论