The full message is
Caused by: org.springframework.beans.factory.UnsatisfiedDependencyException:
Error creating bean with name \'userRepositoryUserDetailsSe
Annotatate your class implementing UserRepository
with spring @Component
annotation
@Component
public MyUserRepository implements UserRepository
{
User findByEmail(String email){
return new User();
}
}
[org.cru.cloud.management.data.UserRepository]: : No qualifying bean of type
Can not find UserRepository bean. Maybe you forgot to put annotation to UserRepository.
@Component
public MyClass implements UserRepository{}
if you autowire userRepository then you MyClass will be injected.
Also :
public MyClass implements UserRepository{}
public YourClass implements UserRepository{}
@Autowired
public blabla(@Qualifier("myClass") UserRepository userRepo)
@Autowired
public blabla(@Qualifier("yourClass") UserRepository userRepo)
I guess this will help.
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).
It seems you are using @EnableJpaRepositories
to configure the database repository. It has two option load beans, the following one method you can use.
@EnableJpaRepositories(basePackages={"com.test.repo"})
or
@EnableJpaRepositories(basePackageClasses=TestRepo.class)