Describe the bug According to the official website,defining required components. When the annotation is set to @ enableWebSecurity (debug=true), an error occurs during project startup. error message:org.springframework.beans.factory.BeanCreationException: Exception encountered during context initialization - cancelling refresh attempt: org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'springSecurityFilterChain': Failed to instantiate [org.springframework.security.config.annotation.web.configuration.WebMvcSecurityConfiguration$CompositeFilterChainProxy]: Constructor threw exception.
Upon reviewing the source code, it was found that when debug=true, the returned object is DebugFilter, while when debug=false, the returned object is FilterChainProxy. When the returned object is DebugFilter, an exception is thrown when executing the findFilterChainProxy method while creating the CompositeFilterChainProxy object. To Reproduce
@Configuration @EnableWebSecurity(debug = true) public class SecurityConfig { ...... }
Expected behavior How can I start normally when @ Enabling WebSecurity (debug=true) is enabled?
Sample sample url
Comment From: marcusdacoregio
Hi, @dalingjiuling. Thanks for the report.
This appears to be a duplicate of https://github.com/spring-projects/spring-security/issues/14370