权限管理启动项目报错

来源:15-4 -前台实现、测试

漫然雪

2018-12-05

Error creating bean with name 'securityConfig' defined in file [E:\project\blog-auth\bin\main\com\oysp\spring\boot\blog\config\SecurityConfig.class]: Initialization of bean failed; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'authenticationProvider' defined in class path resource [com/oysp/spring/boot/blog/config/SecurityConfig.class]: Bean instantiation via factory method failed; nested exception is org.springframework.beans.BeanInstantiationException: Failed to instantiate [org.springframework.security.authentication.AuthenticationProvider]: Circular reference involving containing bean 'securityConfig' - consider declaring the factory method as static for independence from its containing instance. Factory method 'authenticationProvider' threw exception; nested exception is java.lang.IllegalArgumentException: passwordEncoder cannot be null

涉及到的代码我复制粘贴核对后还是报错

写回答

1回答

__serene__

2018-12-06

passwordEncoder cannot be null。

你的这个passwordEncoder 变量是null

0
1
漫然雪
这应该是启动项目insert进去的那个管理员密码吧,问题是我写在sql文件里了?
2018-12-06
共1条回复

基于Spring Boot技术栈博客系统企业级前后端实战

毕设 Elasticsearch搜索+Thymeleaf模板+JPA+Security+BootStrap

1296 学习 · 738 问题

查看课程