Autowiring :expected at least 1 bean which qualifies as autowire candidate for this dependency

前端 未结 5 1713
终归单人心
终归单人心 2021-01-12 06:16

Okay, I know that there are many questions asked around the same topic. But I cant seem to make anything work. It also might be the case that I am yet to completely understa

5条回答
  •  春和景丽
    2021-01-12 06:26

    I think your application is not able to scan the UserRepository class, If you are using Spring Boot then you should put the main class on top of your package hierarchy.

    You should also use @EnableJpaRepositories and tell it the base package of your repos to enable the repository functionality

    @EnableJpaRepositories(basePackages ={"com.springBoot.usl.repo"})

提交回复
热议问题