bean of type 'org.springframework.http.codec.ServerCodecConfigurer' that could not be found

守給你的承諾、 提交于 2020-01-15 08:14:27

问题


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

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!