1、报错内容

Caused by: org.springframework.beans.factory.NoSuchBeanDefinitionException: No qualifying bean of type ‘com.test02.usermodule.service.UserService’ available:

报错——org.springframework.beans.factory.NoSuchBeanDefinitionException: No qualifying bean of

2、解决

看报错:

Spring中找不到com.test02.usermodule.service.UserService这个bean。

所以是不是没有交给Spring容器进行管理呢?给UserService类加上@Service注解即可。交给Spring容器管理。

类似的,如果是***Controller找不到,就加上@Controller注解。

总的来说,就是没有加注解,所以Spring容器找不到这个bean

相关文章:

  • 2022-12-23
  • 2022-12-23
  • 2021-06-22
  • 2022-12-23
  • 2022-02-06
  • 2022-12-23
  • 2021-08-08
  • 2021-04-25
猜你喜欢
  • 2021-09-04
  • 2021-08-04
  • 2021-04-09
  • 2021-07-01
  • 2021-08-26
  • 2021-10-08
  • 2021-11-01
相关资源
相似解决方案