请问这个怎么解决

来源:4-2 Controller-基础代码

慕粉0910006514

2016-12-15 14:20

org.springframework.beans.factory.BeanCreationException: Could not autowire meth
od: public void com.imooc.mvcdemo.controller.CourseController.setCourseService(c
om.imooc.mvcdemo.service.CourseService); nested exception is org.springframework
.beans.factory.NoSuchBeanDefinitionException: No qualifying bean of type [com.im
ooc.mvcdemo.service.CourseService] found for dependency: expected at least 1 bea
n which qualifies as autowire candidate for this dependency. Dependency annotati
ons: {}

这是什么意思啊?

写回答 关注

2回答

  • OnWork
    2016-12-25 15:53:52

    依赖注入可能出错,看看你applicationContext.xml文件有没有配置扫描

    haping...

    已解决,service实现类少了去实现对应的service接口,好蠢

    2019-02-15 17:45:36

    共 2 条回复 >

  • qq_陌路殇_03963765
    2016-12-16 22:06:28

    应该是注解出错了

Spring MVC起步

Java中Spring MVC框架入门教程,快来看最易用的MVC框架

195972 学习 · 572 问题

查看课程

相似问题