Describe the bug

Method springSecurityFilterChain in org.springframework.security.config.annotation.web.configuration.WebSecurityConfiguration required a single bean, but 2 were found: - requestMappingHandlerMapping: defined by method 'requestMappingHandlerMapping' in class path resource [org/springframework/boot/autoconfigure/web/servlet/WebMvcAutoConfiguration$EnableWebMvcConfiguration.class] - controllerEndpointHandlerMapping: defined by method 'controllerEndpointHandlerMapping' in class path resource [org/springframework/boot/actuate/autoconfigure/endpoint/web/servlet/WebMvcEndpointManagementContextConfiguration.class]

To Reproduce 1. Version: Spring boot 2.7.12 & security-config 5.8.3 2. start application failed

Expected behavior start application success

Sample not yet

Comment From: sjohnr

Thanks for getting in touch, but it feels like this is a question that would be better suited to Stack Overflow. We prefer to use GitHub issues only for bugs and enhancements. Feel free to update this issue with a link to the re-posted question (so that other people can find it) or add a minimal sample that reproduces this issue if you feel this is a genuine bug.

Comment From: dylan-tao

Thanks for getting in touch, but it feels like this is a question that would be better suited to Stack Overflow. We prefer to use GitHub issues only for bugs and enhancements. Feel free to update this issue with a link to the re-posted question (so that other people can find it) or add a minimal sample that reproduces this issue if you feel this is a genuine bug.

WebSecurityConfiguration get RequestMappingHandlerMapping bean support: getBean("requestMappingHandlerMapping", RequestMappingHandlerMapping.class) or @qualifier("requestMappingHandlerMapping") ,Why not fix him? Spring Boot 2.7.x WebMvcAutoConfiguration$EnableWebMvcConfiguration init RequestMappingHandlerMapping‘s method has been removed @primary annotation,please fix it

Comment From: sjohnr

@dylan-tao apologies but I'm not quite able to understand you. It sounds as though you're reporting a change in behavior in Spring Boot, because WebMvcAutoConfiguration is a Spring Boot class. Please provide a minimal sample that demonstrates the issue, and also consider making your report in the spring boot issue tracker.