想请教老师run code时候出现了securitycofig需要一个bean type的问题?
来源:16-3 -后台实现
慕的地8056960
2020-08-04
Field userDetailsService in com.example.initializerstart.config.SecurityConfig required a bean of type ‘org.springframework.security.core.userdetails.UserDetailsService’ that could not be found.
然后我尝试增加一个userserviceimplement,然而并还是依然有这个报错,想请教下老师这个问题应该如何解决呢?
然后看上面parent problem的补充说明写的是:
[ main] ationConfigEmbeddedWebApplicationContext : Exception encountered during context initialization - cancelling refresh attempt: org.springframework.beans.factory.UnsatisfiedDependencyException: Error creating bean with name ‘securityConfig’: Unsatisfied dependency expressed through field ‘userDetailsService’; nested exception is org.springframework.beans.factory.NoSuchBeanDefinitionException: No qualifying bean of type ‘org.springframework.security.core.userdetails.UserDetailsService’ available: expected at least 1 bean which qualifies as autowire candidate. Dependency annotations: {@org.springframework.beans.factory.annotation.Autowired(required=true)}
1回答
-
老卫
2020-08-10
版本问题吧。
看我手记,改成与课程一致。032020-09-02
基于Spring Boot技术栈博客系统企业级前后端实战
1296 学习 · 738 问题
相似问题