1. 程式人生 > 其它 >gateway閘道器報錯No qualifying bean of type ‘org.springframework.core.convert.ConversionService‘ available

gateway閘道器報錯No qualifying bean of type ‘org.springframework.core.convert.ConversionService‘ available

技術標籤:web開發java

gateway閘道器報錯No qualifying bean of type ‘org.springframework.core.convert.ConversionService’ available

1、問題分析

  • 報錯:

    Caused by: org.springframework.beans.factory.NoSuchBeanDefinitionException: No qualifying bean of type 'org.springframework.core.convert.ConversionService' available: expected at least 1
    bean which qualifies as autowire candidate. Dependency annotations: {@org.springframework.beans.factory.annotation.Qualifier(value=webFluxConversionService)}
  • 在使用Spring Cloud 進行微服務,分散式開發時,閘道器是請求的第一入口,所以一般把客戶端請求的許可權驗證統一放在閘道器進行認證與鑑權。因為Spring Cloud Gateway使用是基於WebFlux與Netty開發的,所以與傳統的Servlet方式不同。而且閘道器一般不會直接請求資料庫,不提供使用者管理服務,所以不能直接使用web服務。

  • 官網說明:在這裡插入圖片描述

2、解決

刪除依賴

        <dependency>
            <groupId>org.springframework.boot</groupId>
            <artifactId>spring-boot-starter-web</artifactId>
        </dependency>