问题
APPLICATION FAILED TO START
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.
Picked up JAVA_TOOL_OPTIONS: -agentlib:jvmhook
Picked up _JAVA_OPTIONS: -Xbootclasspath/a:"C:\Program Files (x86)\HPE\Unified Functional Testing\bin\java_shared\classes\jasmine.jar"
Picked up JAVA_TOOL_OPTIONS: -agentlib:jvmhook
回答1:
You can try like this:
compile ('org.springframework.cloud:spring-cloud-starter-gateway'){
exclude module : 'spring-cloud-starter'
exclude module : 'spring-boot-starter-webflux'
}
回答2:
Try adding the below code. It worked for me
@Bean
public ServerCodecConfigurer serverCodecConfigurer() {
return ServerCodecConfigurer.create();
}
来源:https://stackoverflow.com/questions/52447223/bean-of-type-org-springframework-http-codec-servercodecconfigurer-that-could-n