欧美bbbwbbbw肥妇,免费乱码人妻系列日韩,一级黄片

springboot集成springCloud中g(shù)ateway時啟動報錯的解決

 更新時間:2021年07月16日 16:37:30   作者:藍(lán)色格子  
這篇文章主要介紹了springboot集成springCloud中g(shù)ateway時啟動報錯的解決方案,具有很好的參考價值,希望對大家有所幫助。如有錯誤或未考慮完全的地方,望不吝賜教

在項目中引入springcloud中的gateway時報以下錯誤

Description:

Parameter 0 of method modifyRequestBodyGatewayFilterFactory in org.springframework.cloud.gateway.config.GatewayAutoConfiguration
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.

這個是由于依賴沖突,spring-cloud-starter-gateway與spring-boot-starter-web和spring-boot-starter-webflux依賴沖突

解決方式:

在引入gateway時過濾掉上面兩個依賴

 <dependency>
            <groupId>org.springframework.cloud</groupId>
            <artifactId>spring-cloud-starter-gateway</artifactId>
            <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整合gateway啟動失敗

問題:

springboot整合gateway啟動失敗

***************************
APPLICATION FAILED TO START
***************************
Description:
An attempt was made to call a method that does not exist. The attempt was made from the following location:
org.springframework.cloud.gateway.config.GatewayAutoConfiguration$NettyConfiguration.gatewayHttpClient(GatewayAutoConfiguration.java:622)
The following method did not exist:
reactor.netty.resources.ConnectionProvider.elastic(Ljava/lang/String;Ljava/time/Duration;Ljava/time/Duration;)Lreactor/netty/resources/ConnectionProvider;
The method's class, reactor.netty.resources.ConnectionProvider, is available from the following locations:
jar:file:/C:/Users/Administrator/.m2/repository/io/projectreactor/netty/reactor-netty/0.9.1.RELEASE/reactor-netty-0.9.1.RELEASE.jar!/reactor/netty/resources/ConnectionProvider.class
It was loaded from the following location:
file:/C:/Users/Administrator/.m2/repository/io/projectreactor/netty/reactor-netty/0.9.1.RELEASE/reactor-netty-0.9.1.RELEASE.jar
Action:
Correct the classpath of your application so that it contains a single, compatible version of reactor.netty.resources.ConnectionProvider
Disconnected from the target VM, address: '127.0.0.1:55875', transport: 'socket'
Process finished with exit code 1

這塊主要是版本兼容的問題,

最初用的版本是:

        <dependency>
            <groupId>io.projectreactor.netty</groupId>
            <artifactId>reactor-netty</artifactId>
            <version>0.9.4.RELEASE</version>
        </dependency>

網(wǎng)上有的是需要把這個版本降低,我這是降低了也不行

最后升高了版本改成了:

        <dependency>
            <groupId>io.projectreactor.netty</groupId>
            <artifactId>reactor-netty</artifactId>
            <version>0.9.14.RELEASE</version>
        </dependency>

本項目里springboot版本為:2.3.1,根據(jù)自己項目需要吧,看一下自己項目中各個版本之間的問題

以上為個人經(jīng)驗,希望能給大家一個參考,也希望大家多多支持腳本之家。

相關(guān)文章

  • Maven 搭建SpringMVC+Hibernate項目詳解

    Maven 搭建SpringMVC+Hibernate項目詳解

    本文主要介紹Maven 搭建SpringMVC+Hibernate的知識,這里整理了詳細(xì)的資料,并附示例代碼,有興趣的小伙伴可以參考下
    2016-09-09
  • IntelliJ?IDEA?2022.2?正式發(fā)布新功能體驗

    IntelliJ?IDEA?2022.2?正式發(fā)布新功能體驗

    IntelliJ?IDEA?2022.2為遠(yuǎn)程開發(fā)功能帶來了多項質(zhì)量改進(jìn),使其更美觀、更穩(wěn)定,新版本還具有多項值得注意的升級和改進(jìn),下面跟隨小編一起看看IDEA?2022.2新版本吧
    2022-08-08
  • Java文件下載ZIP報錯:Out of Memory的問題排查

    Java文件下載ZIP報錯:Out of Memory的問題排查

    本文主要介紹了Java項目中下載大文件(超過2G的ZIP文件)時出現(xiàn)內(nèi)存溢出(OutOfMemory:JavaHeapSpace)的問題,具有一定的參考價值,感興趣的可以了解一下
    2025-01-01
  • Spring思維導(dǎo)圖助你輕松學(xué)習(xí)Spring

    Spring思維導(dǎo)圖助你輕松學(xué)習(xí)Spring

    這篇文章主要為大家詳細(xì)介紹了Spring思維導(dǎo)圖,幫助你輕松學(xué)習(xí)Spring的相關(guān)資料,具有一定的參考價值,感興趣的小伙伴們可以參考一下
    2018-03-03
  • Spring Boot 多個定時器沖突問題的解決方法

    Spring Boot 多個定時器沖突問題的解決方法

    這篇文章主要介紹了Spring Boot 多個定時器沖突問題的解決方法,實際開發(fā)中定時器需要解決多個定時器同時并發(fā)的問題,也要解決定時器之間的沖突問題,本文通過問題場景重現(xiàn)給大家介紹的非常詳細(xì),需要的朋友參考下吧
    2022-05-05
  • Java 使用Thumbnails對大圖片壓縮

    Java 使用Thumbnails對大圖片壓縮

    這篇文章主要介紹了Java 使用Thumbnails對大圖片壓縮,幫助大家更好的利用Java處理圖片,感興趣的朋友可以了解下
    2020-11-11
  • springboot?vue測試平臺開發(fā)調(diào)通前后端環(huán)境實現(xiàn)登錄

    springboot?vue測試平臺開發(fā)調(diào)通前后端環(huán)境實現(xiàn)登錄

    這篇文章主要介紹了springboot?vue測試平臺開發(fā)調(diào)通前后端環(huán)境實現(xiàn)登錄詳解,有需要的朋友可以借鑒參考下,希望能夠有所幫助,祝大家多多進(jìn)步,早日升職加薪
    2022-05-05
  • Spring組件初始化擴(kuò)展點BeanPostProcessor的作用詳解

    Spring組件初始化擴(kuò)展點BeanPostProcessor的作用詳解

    本文通過實戰(zhàn)案例和常見應(yīng)用場景詳細(xì)介紹了BeanPostProcessor的使用,并強(qiáng)調(diào)了其在Spring擴(kuò)展中的重要性,感興趣的朋友一起看看吧
    2025-03-03
  • 基于Java向zip壓縮包追加文件

    基于Java向zip壓縮包追加文件

    這篇文章主要介紹了基于Java向zip壓縮包追加文件,文中通過示例代碼介紹的非常詳細(xì),對大家的學(xué)習(xí)或者工作具有一定的參考學(xué)習(xí)價值,需要的朋友可以參考下
    2019-12-12
  • Java設(shè)計模式七大原則之里氏替換原則詳解

    Java設(shè)計模式七大原則之里氏替換原則詳解

    在面向?qū)ο蟮某绦蛟O(shè)計中,里氏替換原則(Liskov Substitution principle)是對子類型的特別定義。本文將為大家詳細(xì)介紹Java設(shè)計模式七大原則之一的里氏替換原則,需要的可以參考一下
    2022-02-02

最新評論