请稍等 ...
×

采纳答案成功!

向帮助你的同学说点啥吧!感谢那些助人为乐的人

有实现类的,好像主要是这两个错误。UserDetailsService这个类注入失败

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)}

Error handling failed (Error creating bean with name ‘delegatingApplicationListener’ defined in class path resource [org/springframework/security/config/annotation/web/configuration/WebSecurityConfiguration.class]: BeanPostProcessor before instantiation of bean failed; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name ‘metaDataSourceAdvisor’: Cannot resolve reference to bean ‘methodSecurityMetadataSource’ while setting constructor argument; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name ‘org.springframework.security.config.annotation.method.configuration.GlobalMethodSecurityConfiguration’: Initialization of bean failed; nested exception is org.springframework.beans.factory.NoSuchBeanDefinitionException: No bean named ‘org.springframework.context.annotation.ConfigurationClassPostProcessor.importRegistry’ available)

正在回答

1回答

看下课程,UserService 会实现 UserDetailsService借口,你的代码有实现吗?

1 回复 有任何疑惑可以回复我~
  • 提问者 最江湖 #1
    非常感谢!
    回复 有任何疑惑可以回复我~ 2019-03-11 15:22:02
问题已解决,确定采纳
还有疑问,暂不采纳
微信客服

购课补贴
联系客服咨询优惠详情

帮助反馈 APP下载

慕课网APP
您的移动学习伙伴

公众号

扫描二维码
关注慕课网微信公众号