admin管理员组文章数量:1640964
The bean 'requestMappingHandlerAdapter', defined in class path resource [org/springframework/boot/autoconfigure/web/servlet/WebMvcAutoConfiguration$EnableWebMvcConfiguration.class], could not be registered. A bean with that name has already been defined in class path resource [org/springframework/web/reactive/config/DelegatingWebFluxConfiguration.class] and overriding is disabled.
由于我的common的模块引入了
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-web</artifactId>
</dependency>
网关中的 spring-boot-starter-webflux 包含了spring-web 的依赖,所以
目前我在资源服务器中使用了 SecurityWebFilterChain (spring-web下的一个配置类)类,建议在引入common模块(或其他包含spring-web、spring-boot-starter-web模块)排除掉
,如下:
<dependency>
<groupId>com.zmc</groupId>
<artifactId>common</artifactId>
<version>1.0-SNAPSHOT</version>
<exclusions>
<exclusion>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-web</artifactId>
</exclusion>
</exclusions>
</dependency>
排除后,common模块又开始报错了,因为我在common模块中引入了servlet相关的东西,如:
javax.servlet.ServletRequest
但在网关中引入是排除了spring-boot-start-web , 可以引入这一块相关的jar依赖解决(其实可以直接删除spring-start-web依赖,只要引用的东西不多,可以引入细粒度的jar就行)
<dependency>
<groupId>javax.servlet</groupId>
<artifactId>javax.servlet-api</artifactId>
</dependency>
本文标签: WebFluxSecurityConfigurationGatewayclassdisabledoverriding
版权声明:本文标题:gateway 报 WebFluxSecurityConfiguration.class] and overriding is disabled. 内容由热心网友自发贡献,该文观点仅代表作者本人, 转载请联系作者并注明出处:https://m.elefans.com/xitong/1729317742a1195505.html, 本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌抄袭侵权/违法违规的内容,一经查实,本站将立刻删除。
发表评论