• Consider defining a bean of type 'org.springframework.http.codec.ServerCodecConfigurer' in your configuration.


    错误详细信息:

    ***************************
    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>

    参考解决办法:
    springboot集成springCloud中gateway时启动报错

  • 相关阅读:
    tkinter_战队数据查询系统
    python_tkinter组件
    python_tkinter基本属性
    python_tkinter组件摆放方式
    python_推导式
    python_装饰器
    python_模块1
    python_生成随机验证码
    linux基础_使用指令3
    linux部署django项目流程(全)
  • 原文地址:https://www.cnblogs.com/youcong/p/13939473.html
Copyright © 2020-2023  润新知