在开始学习SpringBoot使用Spring-data-jpa中的JpaRepository时报错: 

SpringBoot单元测试报No qualifying bean of type 'com.didispace.domain.UserRepository' available

解决办法:

  1. 继承的JpaRepository接口必须加@Repository注解
  2. SpringBoot启动类必须加@EnableJpaRepositories(basePackages="xx.xx.xx")注解
  3. SpringBoot启动类必须加@@EntityScan(basePackages="xx.xx.xx")注解

 齐活!

相关文章:

  • 2022-12-23
  • 2021-09-29
  • 2021-08-08
  • 2021-09-04
  • 2021-08-28
  • 2022-01-20
  • 2022-12-23
  • 2022-12-23
猜你喜欢
  • 2021-12-18
  • 2021-11-14
  • 2022-12-23
  • 2021-04-25
  • 2021-10-20
  • 2022-12-23
  • 2022-02-06
相关资源
相似解决方案