Apparent Spring Boot race condition causing duplicate springSecurityFilterChain registration

后端 未结 2 1172
野趣味
野趣味 2021-02-06 04:34

I have a REST-full web service implemented with Spring Boot 1.2.0-RELEASE that occasionally throws the following exception on startup.

03-Feb-2015 11:42:23.697 S         


        
2条回答
  •  没有蜡笔的小新
    2021-02-06 05:14

    Following spring boot documentation you should disable the default security configuration loaded by spring boot by adding annotation @EnableWebMvcSecurity in your app configuration (see 75.2 Change the AuthenticationManager and add user accounts) and than you should configure a web security adapter like this:

    @Bean
    WebSecurityConfigurerAdapter webSecurityAdapter() {
       WebSecurityConfigurerAdapter adapter = new WebSecurityConfigurerAdapter() {
                @Override
                protected void configure(HttpSecurity http) throws Exception {
                    http....
    

提交回复
热议问题