Open aaric opened 6 months ago
latest (io.projectreactor:reactor-core:3.1.4.RELEASE 发布年份2018-02-15)
ClassNotFoundException: reactor.util.context.ContextView
Spring Cloud Gateway不被影响
1.正常搭建网关,引入依赖
ext { // https://github.com/alibaba/spring-cloud-alibaba/wiki/版本说明#毕业版本依赖关系推荐使用 springCloudVersion = "2022.0.0" springCloudAlibabaVersion = "2022.0.0.0" knife4jVersion = "4.5.0" saTokenVersion = "1.37.0" } dependencyManagement { imports { mavenBom "org.springframework.cloud:spring-cloud-dependencies:$springCloudVersion" mavenBom "com.alibaba.cloud:spring-cloud-alibaba-dependencies:$springCloudAlibabaVersion" mavenBom "com.github.xiaoymin:knife4j-dependencies:$knife4jVersion" mavenBom "cn.dev33:sa-token-dependencies:$saTokenVersion" } } dependencies { implementation project(":v2x-common") implementation "com.github.xiaoymin:knife4j-gateway-spring-boot-starter" // Fixed: ClassNotFoundException: reactor.util.context.ContextView //implementation "io.projectreactor:reactor-core:3.5.4" implementation "org.springframework.cloud:spring-cloud-starter-gateway" implementation "org.springframework.cloud:spring-cloud-starter-loadbalancer" implementation "org.springframework.cloud:spring-cloud-starter-bootstrap" implementation "com.alibaba.cloud:spring-cloud-starter-alibaba-nacos-discovery" implementation "com.alibaba.cloud:spring-cloud-starter-alibaba-nacos-config" implementation "org.springframework.boot:spring-boot-starter-log4j2" }
2.网关启动报错
3.原因分析 最新的cn.dev33:sa-token-dependencies:1.38.0使用的reactor-core版本还是<reactor-core.version>3.1.4.RELEASE</reactor-core.version>,Spring Cloud Gateway 2022已经使用reactor-core 3.x,WebFlux框架高度依赖Reactor,建议保持和 Gateway Reactor版本同步。
cn.dev33:sa-token-dependencies:1.38.0
<reactor-core.version>3.1.4.RELEASE</reactor-core.version>
< 备注:如果复现步骤比较复杂,请将 demo 上传到 gitee 并留下地址 >
使用版本:
latest (io.projectreactor:reactor-core:3.1.4.RELEASE 发布年份2018-02-15)
报错信息:
ClassNotFoundException: reactor.util.context.ContextView
希望结果:
Spring Cloud Gateway不被影响
复现步骤:
1.正常搭建网关,引入依赖
2.网关启动报错
3.原因分析 最新的
cn.dev33:sa-token-dependencies:1.38.0
使用的reactor-core版本还是<reactor-core.version>3.1.4.RELEASE</reactor-core.version>
,Spring Cloud Gateway 2022已经使用reactor-core 3.x,WebFlux框架高度依赖Reactor,建议保持和 Gateway Reactor版本同步。< 备注:如果复现步骤比较复杂,请将 demo 上传到 gitee 并留下地址 >