【发布时间】:2021-09-21 17:42:03
【问题描述】:
当我运行我的 spring boot 应用程序时,我收到以下错误:
org.springframework.beans.factory.UnsatisfiedDependencyException:创建名为“webSecurityConfig”的bean时出错:通过字段“userDetailsService”表示的依赖关系不满足;嵌套异常是 org.springframework.beans.factory.NoSuchBeanDefinitionException:没有“org.springframework.security.core.userdetails.UserDetailsService”类型的合格 bean 可用:预计至少有 1 个有资格作为自动装配候选者的 bean。依赖注解:{@org.springframework.beans.factory.annotation.Qualifier("userDetailsServiceImpl"), @org.springframework.beans.factory.annotation.Autowired(required=true)}
请帮我解决这个错误...
【问题讨论】:
-
我认为您应该根据需要声明一个返回 UserDetailsService 的 bean 配置。
标签: spring spring-boot