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)}
毕设 Elasticsearch搜索+Thymeleaf模板+JPA+Security+BootStrap
了解课程