我在 spring boot 中编写应用程序,在添加 spring boot security 后,我遇到了编译问题。有人可以帮助我吗,或者以前有人遇到过这样的问题吗?
问题:
Description:
A component required a bean of type 'org.springframework.security.config.annotation.ObjectPostProcessor' that could not be found.
Action:
Consider defining a bean of type 'org.springframework.security.config.annotation.ObjectPostProcessor' in your configuration.
代码
@Configuration
public class WebSecurityConfiguration extends WebSecurityConfigurerAdapter {
private UserService userService;
public WebSecurityConfiguration(UserService userService) {
this.userService = userService;
}
@Override
protected void configure(AuthenticationManagerBuilder auth) throws Exception {
auth.userDetailsService(userService);
}
@Override
protected void configure(HttpSecurity http) throws Exception {
super.configure(http);
}
}
感谢您的帮助!