spring cloud gateway版本问题
来源:10-3 编写Spring Cloud Gateway
 
			陈大大666
2020-07-02
老师你好!
我使用的 Cloud 版本比较新 是 Hoxton.SR6
Spring boot 版本是 2.2.4.RELEASE
Spring cloud alibaba 版本是 2.1.0.RELEASE
我的依赖是,没有给版本号,查看是版本是2.2.3的
<dependency>
	<groupId>org.springframework.cloud</groupId>
	<artifactId>spring-cloud-starter-gateway</artifactId>
</dependency>
配置就开启了网关自动服务发现
网关启动的时候报错
提示 spring-webflux/5.2.3.RELEASE 缺少 某个方法 ,我把  spring-webflux/5.2.3.RELEASE进行了降级
依旧提示,我甚至把  Spring boot 降级到2.1.9  .Cloud版本降级到 Greenwich SR6
yml配置和课堂上一样,但还是一样报错。能帮我解决下,
2回答
- 
				  大目 2020-07-02 这两个版本不兼容。 建议参考下课程4.2节,挑选兼容的Spring Boot、Spring Cloud以及Spring Cloud Alibaba版本。 Spring boot 降级到2.1.9 .Cloud版本降级到 Greenwich SR6 这个是兼容的。 00
- 
				  陈大大666 提问者 2020-07-02 哦,刚刚发表完就网上找到了答案 说是 这个是由于依赖冲突,spring-cloud-starter-gateway与spring-boot-starter-web和spring-boot-starter-webflux依赖冲突 解决方式:在引入gateway时过滤掉上面两个依赖 <dependency> <groupId>org.springframework.cloud</groupId> <artifactId>spring-cloud-starter-gateway</artifactId> <exclusions> <exclusion> <groupId>org.springframework.boot</groupId> <artifactId>spring-boot-starter-web</artifactId> </exclusion> <exclusion> <groupId>org.springframework.boot</groupId> <artifactId>spring-boot-starter-webflux</artifactId> </exclusion> </exclusions> </dependency> 这个问题解决,但启动时提示 ********************************************************** Spring Webflux is missing from the classpath, which is required for Spring Cloud Gateway at this time. Please add spring-boot-starter-webflux dependency. ********************************************************** 012020-07-02
相似问题
