今天用从zuul网关换到spring cloud gateway网关,配置好项目后访问报错如下:

java.lang.ClassCastException: org.springframework.core.io.buffer.DefaultDataBufferFactory cannot be cast to org.springframework.core.io.buffer.NettyDataBufferFactory

最终发现是包冲突下面这个包

compile 'org.springframework.boot:spring-boot-starter-undertow'

PS:检查自己的依赖里是否有spring-boot-starter-web,这个会冲突。

gataway路由功能仅此需要,eureka另说。

implementation 'org.springframework.cloud:spring-cloud-starter-gateway'

 

 

Logo

云原生社区为您提供最前沿的新闻资讯和知识内容

更多推荐