今天在搭建springBoot的时候,遇到了A component required a bean of type 'com.example.demo3.service.StuService' that could not be found.这个错误,意思是这个service和我的controller层在同级目录,所以找不到这个bean。然后我就把这个Controller里的那个类给提出来了,就可以了。见图,turnPage原本是在controller包里的,就会出现依赖注入不进去,报错,下图是我把那个类拿出来了,就可以了,不知道有没有大神有好的解决办法,一定要告诉小弟,感激不尽:

A component required a bean of type 'com.example.demo3.service.StuService' that could not be found

相关文章:

  • 2022-12-23
  • 2022-12-23
  • 2021-08-14
  • 2022-12-23
  • 2022-12-23
  • 2021-11-20
  • 2022-12-23
  • 2021-12-26
猜你喜欢
  • 2022-12-23
  • 2021-05-23
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2021-09-18
  • 2021-09-11
相关资源
相似解决方案