问答详情
源自:4-2 Controller-基础代码

请问这个怎么解决

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: {}

这是什么意思啊?

提问者:慕粉0910006514 2016-12-15 14:20

个回答

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

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

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

    应该是注解出错了