异常NoSuchBeanDefinitionException: No qualifying bean of type ‘Bean.person’ available: expected at least 1 bean which qualifies as autowire candidate.

近日,刚学习springboot,在test中测试,却产生一堆红色报错。
SpingBoot异常
org.springframework.beans.factory.UnsatisfiedDependencyException: Error creating bean with name ‘com.example.springboot1.DemoApplicationTests’: Unsatisfied dependency expressed through field ‘p’; nested exception is org.springframework.beans.factory.NoSuchBeanDefinitionException: No qualifying bean of type ‘Bean.person’ available: expected at least 1 bean which qualifies as autowire candidate. Dependency annotations: {@org.springframework.beans.factory.annotation.Autowired(required=true)}
这段报错提示的是NoSuchBeanDefinitionException: No qualifying bean of type ‘Bean.person’ available: expected at least 1 bean which qualifies as autowire candidate.
解决方法是将
SpingBoot异常
要运行的文件需放入与SpringBootApplication同文件夹以下(包含同文件夹下)的位置。
SpingBoot异常
提示:springboot文件的东西都需要在SpringBootApplication同文件夹以下(包含同文件夹下)的位置。

相关文章:

  • 2022-12-23
  • 2021-08-19
  • 2022-02-10
  • 2021-05-16
  • 2021-12-27
  • 2022-12-23
  • 2022-02-05
  • 2021-10-23
猜你喜欢
  • 2021-09-18
  • 2021-10-25
  • 2021-06-05
  • 2021-08-07
  • 2022-03-06
  • 2021-11-11
  • 2021-10-10
相关资源
相似解决方案