异常信息:

Spring MVC Autowired – No qualifying bean of type [] found for dependency: expected at least 1 bean which qualifies
No qualifying bean of type [...Service] 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)}

说的很清楚了了,自动注入的时候,找不到对应的bean;

解决方案:

用eclipse的export导出时,选中那个add directory entries复选框。否则的话你导出的jar包没有目录结构,从而造成你的问题。

Spring MVC 基于注解的class文件打成jar包后注入失败

勾上后,打包完成,并放入项目中,进行重新启动,不再报错。

转载自:https://blog.csdn.net/goddessming/article/details/76849805

相关文章:

  • 2022-12-23
  • 2021-11-24
  • 2021-09-30
  • 2021-08-13
  • 2022-12-23
  • 2022-01-16
  • 2021-08-23
  • 2021-04-17
猜你喜欢
  • 2021-07-22
  • 2022-02-08
  • 2021-09-01
  • 2021-04-22
  • 2022-02-21
  • 2021-04-27
  • 2021-12-13
相关资源
相似解决方案