【发布时间】:2019-05-23 15:48:35
【问题描述】:
这是我的代码 - https://github.com/iyngaran/to-do-list
我在 info.iyngaran.core.auth.repository 包中有 UserRepository 类,它带有 @Repository 注释。
当我尝试将其注入 info.iyngaran.core.auth.security 包中的 CustomUserDetailsService 类时,我收到以下错误。
org.springframework.beans.factory.UnsatisfiedDependencyException: Error creating bean with name 'customUserDetailsService': Unsatisfied dependency expressed through field 'userRepository'; nested exception is org.springframework.beans.factory.NoSuchBeanDefinitionException: No qualifying bean of type 'info.iyngaran.core.auth.repository.UserRepository' available: expected at least 1 bean which qualifies as autowire candidate. Dependency annotations: {@org.springframework.beans.factory.annotation.Autowired(required=true)}
有人可以帮我找出这个问题吗?提前致谢。
【问题讨论】:
标签: java spring spring-boot dependency-injection