无法添加UserDetailsService是怎么回事

来源:4-9 添加记住我功能

向量烟灰

2019-03-04

在BrowserSecurityConfig添加出错
@Autowired
private UserDetailsService userDetailsService;

添加了 @Qualifier(“myUserDetailsService”)一样出错是怎么一回事

2019-03-04 13:46:18.704 WARN 22101 — [ main] ConfigServletWebServerApplicationContext : Exception encountered during context initialization - cancelling refresh attempt: org.springframework.beans.factory.BeanCreationException: Error creating bean with name ‘springSecurityFilterChain’ defined in class path resource [org/springframework/security/config/annotation/web/configuration/WebSecurityConfiguration.class]: Bean instantiation via factory method failed; nested exception is org.springframework.beans.BeanInstantiationException: Failed to instantiate [javax.servlet.Filter]: Factory method ‘springSecurityFilterChain’ threw exception; nested exception is java.lang.NullPointerException

写回答

1回答

JoJo

2019-03-04

额...首先,确认框架的版本。如果版本和我用的一致,打个断点看一下报空指针那行是什么代码,为什么会报空指针。

0
5
向量烟灰
非常感谢!
2019-03-08
共5条回复

Spring Security技术栈开发企业级认证与授权

Spring Security技术栈,REST风格开发常见接口,独立开发认证授权模块保证REST服务安全

2662 学习 · 1561 问题

查看课程