Springbootadmin与security冲突问题及解决
Springbootadmin与security冲突
最近在研究springbootadmin监控服务,springboot版本使用3.2.5,security使用6.4.0-SNAPSHOT,集成了springbootadmin后,
一直报错
Parameter 0 of method setFilterChains 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]This may be due to missing parameter name information
我用的springbootadmin
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-actuator</artifactId>
</dependency>
<!-- spring-boot-admin-client -->
<dependency>
<groupId>de.codecentric</groupId>
<artifactId>spring-boot-admin-starter-client</artifactId>
<version>3.2.3</version>
</dependency>网上到处找了资料,说是actuator 中自带security,与另一个security冲突
使用了各种方法都不能解决,最后请教大神,在bean上指定名称即可。
解决


总结
以上为个人经验,希望能给大家一个参考,也希望大家多多支持脚本之家。
相关文章
Java中StringBuilder与StringBuffer使用及源码解读
我们前面学习的String就属于不可变字符串,因为理论上一个String字符串一旦定义好,其内容就不可再被改变,但实际上,还有另一种可变字符串,包括StringBuilder和StringBuffer两个类,那可变字符串有什么特点,又怎么使用呢,接下来就请大家跟我一起来学习吧2023-05-05
Spring Boot 整合 Fisco Bcos部署、调用区块链合约的案例
本篇文章介绍 Spring Boot 整合 Fisco Bcos 的相关技术,最最重要的技术点,部署、调用区块链合约的工程案例,本文通过流程分析给大家介绍的非常详细,需要的朋友参考下吧2022-01-01


最新评论