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
Try adding the below code. It worked for me
@Bean
public ServerCodecConfigurer serverCodecConfigurer() {
return ServerCodecConfigurer.create();
}
You can try like this:
compile ('org.springframework.cloud:spring-cloud-starter-gateway'){
exclude module : 'spring-cloud-starter'
exclude module : 'spring-boot-starter-webflux'
}
I had the same issue building a spring cloud version 2020.0.0
and Keycloak
, it seems that the Keycloak
jar files includes a dependency on spring-boot-start-web
Telling maven NOT to include the default spring-boot-start-web
as follows resolved that issue.
<dependency>
<groupId>org.keycloak</groupId>
<artifactId>keycloak-spring-boot-starter</artifactId>
<exclusions>
<exclusion>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-web</artifactId>
</exclusion>
</exclusions>
</dependency>
But I had to include a maven dependency to the servlet
jar as to resolve some other requirements of Keycloak
as follows:
<dependency>
<groupId>javax.servlet</groupId>
<artifactId>javax.servlet-api</artifactId>
<version>4.0.1</version>
</dependency>
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With