Spring Boot 3.0.4 + Spring actuator 3.0.4
Why is this Spring default code causing this? Is my version incorrect?
Description:
Field httpSecurity 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]
-
Comment From: wilkinsona
The httpSecurity field is a org.springframework.security.config.annotation.web.builders.HttpSecurity. Neither requestMappingHandlerMapping nor controllerEndpointHandlerMapping is an instance of HttpSecurity so the cause of the error isn't clear.
If you would like us to spend some more time investigating, please spend some time providing a complete yet minimal sample that reproduces the problem. You can share it with us by pushing it to a separate repository on GitHub or by zipping it up and attaching it to this issue.
Comment From: xxscloud5722
Thank you. I'm replaying the code I wrote and it seems like I found the problem
Comment From: xxscloud5722
Thank you for resolving the issue. The scanning paths have been safely grouped, and now the loading order has been adjusted and resolved through name matching. The error message from Spring just now still made me understand it incorrectly. I found the wrong problem and found the cause by playing back the code