小白白不白白 2020-01-16 10:37 采纳率: 0%
浏览 318

contorller中 中用注解调用ServiceImpl层异常,求前辈指点

我在contorller类中用注解的方式实现Service就会报错
图片说明
报错内容如下
org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'userController': Injection of autowired dependencies failed; nested exception is org.springframework.beans.factory.BeanCreationException: Could not autowire field: private supermarket.service.UserServiceSuper supermarket.controller.UserController.userService; nested exception is org.springframework.beans.factory.NoSuchBeanDefinitionException: No qualifying bean of type [supermarket.service.UserServiceSuper] found for dependency: expected at least 1 bean which qualifies as autowire candidate for this dependency. Dependency annotations: {@org.springframework.beans.factory.annotation.Autowired(required=true), @org.springframework.beans.factory.annotation.Qualifier(value=userServiceMark)}



但是我若是用context去取userService就正常运行,UserServiceSuper userService=(UserServiceSuper)context.getBean("userServiceMark");
就是用注解就不行,我查了 网上说是@Autowired的错误,但我找不出来. 恳求前辈指点一下呀 感谢

问题关键就是controller层无法通过注解调用



图片说明


图片说明


图片说明


图片说明

  • 写回答

1条回答 默认 最新

  • 关注
    评论

报告相同问题?

悬赏问题

  • ¥15 js调用html页面需要隐藏某个按钮
  • ¥15 ads仿真结果在圆图上是怎么读数的
  • ¥20 Cotex M3的调试和程序执行方式是什么样的?
  • ¥15 一道python难题3
  • ¥15 用matlab 设计一个不动点迭代法求解非线性方程组的代码
  • ¥15 牛顿斯科特系数表表示
  • ¥15 arduino 步进电机
  • ¥20 程序进入HardFault_Handler
  • ¥15 oracle集群安装出bug
  • ¥15 关于#python#的问题:自动化测试