- 📚 相关推荐文章
- 2023年springcloud面试题(第一部分) 推荐
- spring security异常记录:org.springframework.security.access.AccessDeniedException: Access is denied 推荐
- spring框架报错:java.lang.NoClassDefFoundError: orgspringframeworkaopTargetSource 推荐
- Spring框架中@Resource注解报错解决方案 推荐
- Spring框架(SpringBoot)中redis报错(Could not get a resource from the pool、java.net.SocketTimeoutException) 推荐

springCloud Gateway 报错:Consider defining a bean of type ‘org.springframework
网关异常报Consider defining a bean of type 'org.springframework.http.codec.ServerCodec, 要排除其他依赖的spring-boot-starter-web,因为会与spring cloud Gateway的webflux冲突。
<!-- 核心模块,因为我的核心模块引入了spring-boot-starter-web,将其排除 --> <dependency> <groupId>huluwa</groupId> <artifactId>boss-xtrain-core</artifactId> <version>${huluwa.version}</version> <exclusions> <exclusion> <groupId>org.springframework.boot</groupId> <artifactId>spring-boot-starter-web</artifactId> </exclusion> </exclusions> </dependency> <!--新增gateway,要排除其他依赖的spring-boot-starter-web,因为会与gateway的webflux冲突 不排除依赖报Consider defining a bean of type 'org.springframework.http.codec.ServerCodecConfigurer' in your configuration.--> <dependency> <groupId>org.springframework.cloud</groupId> <artifactId>spring-cloud-starter-gateway</artifactId> </dependency>至此,成功解决~
👁️ 阅读量:0
© 版权声明:本文《springCloud Gateway 报错:Consider defining a bean of type ‘org.springframework》内容均为本站精心整理或网友自愿分享,如需转载请注明原文出处:https://www.zastudy.cn/wen/1686557168a291361.html。