一看就会的超详细教程:SpringBoot整合MybatisPlus!>>>
这里根据官网新推出的springcloud Hoxton.SR11版本去集成gateway的一个坑
首先先写版本号:
框架 | 版本号 |
---|---|
springcloud | Hoxton.SR11 |
springboot | 2.3.0 |
根据官网推荐,springcloud这个版本支持的springboot是2.3.0。
在集成gateway网关时会报错如下:
*************************** APPLICATION FAILED TO START *************************** Description: An attempt was made to call a method that does not exist. The attempt was made from the following location: org.springframework.cloud.gateway.config.GatewayAutoConfiguration$NettyConfiguration.buildConnectionProvider(GatewayAutoConfiguration.java:798) The following method did not exist: reactor.netty.resources.ConnectionProvider$Builder.evictInBackground(Ljava/time/Duration;)Lreactor/netty/resources/ConnectionProvider$ConnectionPoolSpec; The method's class, reactor.netty.resources.ConnectionProvider$Builder, is available from the following locations: jar:file:/D:/repo/io/projectreactor/netty/reactor-netty/0.9.7.RELEASE/reactor-netty-0.9.7.RELEASE.jar!/reactor/netty/resources/ConnectionProvider$Builder.class It was loaded from the following location: file:/D:/repo/io/projectreactor/netty/reactor-netty/0.9.7.RELEASE/reactor-netty-0.9.7.RELEASE.jar Action: Correct the classpath of your application so that it contains a single, compatible version of reactor.netty.resources.ConnectionProvider$Builder
从报错信息中可以看到,我们报错因为以来冲突。所以将reactor-netty的包版本降低,故pom中添加如下依赖。
<dependency> <groupId>io.projectreactor.netty</groupId> <artifactId>reactor-netty</artifactId> <version>0.9.4.RELEASE</version> </dependency>