Spring Unsatisfied dependency expressed through constructor argument with index 0 of type

后端 未结 4 2027
既然无缘
既然无缘 2021-02-07 22:24

The full message is

Caused by: org.springframework.beans.factory.UnsatisfiedDependencyException: 
    Error creating bean with name \'userRepositoryUserDetailsSe         


        
4条回答
  •  耶瑟儿~
    2021-02-07 23:21

    Do you have the @EnableJpaRepositories annotation somewhere in your config classes and is the scan set up correctly? By default the package in which the annotated class or interface exists becomes the base package for repository scan. You can control that by setting a value to the basePackages (or even better - basePackageClasses) property.

    You could use Spring Tools Suite to check, what beans are declared in your context (Repositories should be visible under Spring Elements > Beans > Spring Data Repositories).

提交回复
热议问题