gateway启动报错
Consider defining a bean of type ‘org.springframework.http.codec.ServerCodecConfigurer’ in your configuration.
原因是gateway依赖了common包,而gateway坐标spring-cloud-starter-gateway依赖了web坐标,所以坐标冲突
解决办法
加入以下忽略依赖即可
<dependency>
<groupId>com.package.package</groupId>
<artifactId>common</artifactId>
<version>1.0-SNAPSHOT</version>
<exclusions>
<exclusion>
<groupId>org.springframework</groupId>
<artifactId>spring-webmvc</artifactId>
</exclusion>
</exclusions>
</dependency>
DefaultDataBufferFactory cannot be cast to org.springframework.core.io.buffer.NettyDataBufferFactory
gateway默认使用的是webFlux,而Tomcat使用的是netty,把Tomcat的core忽略掉即可
<exclusions>
<exclusion>
<groupId>org.springframework</groupId>
<artifactId>spring-webmvc</artifactId>
</exclusion>
<exclusion>
<groupId>org.apache.tomcat.embed</groupId>
<artifactId>tomcat-embed-core</artifactId>
</exclusion>
</exclusions>