gateway 报错 Parámetro 0 del método websocketRoutingFilter en org.springframework.cloud.gateway.config

***************************
APPLICATION FAILED TO START
***************************
 
Description:
 
Parameter 0 of method websocketRoutingFilter in org.springframework.cloud.gateway.config.GatewayAutoConfiguration required a bean of type 'org.springframework.web.reactive.socket.client.WebSocketClient' that could not be found.
 
The following candidates were found but could not be injected:
	- Bean method 'reactorNettyWebSocketClient' in 'GatewayAutoConfiguration.NettyConfiguration' not loaded because @ConditionalOnClass did not find required class 'reactor.ipc.netty.http.client.HttpClient'
 
 
Action:
 
Consider revisiting the entries above or defining a bean of type 'org.springframework.web.reactive.socket.client.WebSocketClient' in your configuration.
 
Disconnected from the target VM, address: '127.0.0.1:52208', transport: 'socket'

Informé un error al jugar a Gateway hoy, y luego leí muchas soluciones de Baidu. Todavía no funciona. Finalmente, intenté cambiar dos lugares:

1. Versión: Muchos tutoriales en línea decían que el arranque debería estar en la versión 2.0.0, porque mi boot2.1.5 y la versión en la nube Finchley.RELEASE no han funcionado. Finalmente, cambié la versión de arranque a 2.0.0

2. Embalaje: se requiere embalaje en pom

Adjunte mi pom y luego comience completamente bien ~

<dependencies>
        <dependency>
            <groupId>org.springframework.cloud</groupId>
            <artifactId>spring-cloud-starter-netflix-eureka-client</artifactId>
        </dependency>
        <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>
        <dependency>
            <groupId>org.springframework.boot</groupId>
            <artifactId>spring-boot-starter-web</artifactId>
            <version>2.0.0.RELEASE</version>
        </dependency>
        <dependency>
            <groupId>org.springframework.boot</groupId>
            <artifactId>spring-boot-starter-actuator</artifactId>
            <version>2.0.0.RELEASE</version>
        </dependency>
        <dependency>
            <groupId>org.example</groupId>
            <artifactId>cloud-commons</artifactId>
            <version>1.0-SNAPSHOT</version>
        </dependency>

        <!--<dependency>
            <groupId>org.springframework.boot</groupId>
            <artifactId>spring-boot-devtools</artifactId>
            <version>2.0.0.RELEASE</version>
            <scope>runtime</scope>
            <optional>true</optional>
        </dependency>-->
        <dependency>
            <groupId>org.projectlombok</groupId>
            <artifactId>lombok</artifactId>
            <optional>true</optional>
        </dependency>
        <!--<dependency>
            <groupId>org.springframework.boot</groupId>
            <artifactId>spring-boot-starter-test</artifactId>
            <version>2.0.0.RELEASE</version>
            <scope>test</scope>
        </dependency>-->
    </dependencies>
    <!--boot整合cloud的版本使用,配置上自动去下合适的jar包版本-->
    <dependencyManagement>
        <dependencies>
            <dependency>
                <groupId>org.springframework.cloud</groupId>
                <artifactId>spring-cloud-dependencies</artifactId>
                <version>Finchley.RELEASE</version>
                <type>pom</type>
                <scope>import</scope>
            </dependency>
        </dependencies>
    </dependencyManagement>

 

Supongo que te gusta

Origin blog.csdn.net/qq_39809613/article/details/109511426
Recomendado
Clasificación