錯誤詳細信息:
*************************** APPLICATION FAILED TO START *************************** Description: Parameter 1 of constructor in com.alibaba.cloud.sentinel.gateway.scg.SentinelSCGAutoConfiguration required a bean of type 'org.springframework.http.codec.ServerCodecConfigurer' that could not be found. Action: Consider defining a bean of type 'org.springframework.http.codec.ServerCodecConfigurer' in your configuration.
錯誤背景
集成redisson出現這個錯誤
redisson的maven依賴如下:
<dependency> <groupId>org.redisson</groupId> <artifactId>redisson-spring-boot-starter</artifactId> <version>3.11.4</version> </dependency>
錯誤原因分析
這是因為redisson里有spring-boot-starter-web導致的。因為我的springcloud-gateway也有這個依賴,依賴沖突導致啟動報錯。
解決辦法
排除依賴即可,如下:
<dependency> <groupId>org.redisson</groupId> <artifactId>redisson-spring-boot-starter</artifactId> <version>3.11.4</version> <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>