org.springframework.beans.factory.UnsatisfiedDependencyException: Error creating bean with name ‘booksController’: Unsatisfied dependency expressed through field ‘booksService’; nested exception is org.springframework.beans.factory.NoSuchBeanDefinitionException: No qualifying bean of type ‘com.huang.ssmbuild.service.BooksService’ available: expected at least 1 bean which qualifies as autowire candidate. Dependency annotations: {@org.springframework.beans.factory.annotation.Autowired(required=true)}

这个问题是因为BooksService中的实现类并没有注入到bean中。
错误之前:
报错:org.springframework.beans.factory.UnsatisfiedDependencyException
报错:org.springframework.beans.factory.UnsatisfiedDependencyException
而@Service注解是需要加在BooksServiceImpl中的,而BooksService仅仅只是一个接口。这样就能把BooksService所对应的BooksServiceImpl具体实现类或方法注入到bean中。

报错:org.springframework.beans.factory.UnsatisfiedDependencyException

相关文章:

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