원두형의 원두. 원두형. 원두형. 원두형. 원두형. 원두형.ServerCodecConfigurer'를 찾을 수 없습니다.
응용 프로그램 시작 실패
설명:
메서드의 매개 변수 0modifyRequestBodyGatewayFilterFactory
에org.springframework.cloud.gateway.config.GatewayAutoConfiguration
유형의 콩이 필요한.'org.springframework.http.codec.ServerCodecConfigurer'
찾을 수 없습니다.
작업:
유형의 콩을 정의하는 것을 고려합니다.'org.springframework.http.codec.ServerCodecConfigurer'
사용자 구성에서.
JAVA_를 선택했습니다.TOOL_OPTIONS: -agentlib:jvmhook
_JAVA_OPTIONS 선택: -Xbootclasspath/a:"C:\프로그램 파일(x86)\HPE\통합 기능 테스트\bin\java_shared\classes\jasmin.jar"
JAVA_를 선택했습니다.TOOL_OPTIONS: -agentlib:jvmhook
아래 코드를 추가해 보십시오.그것은 나에게 효과가 있었다.
@Bean
public ServerCodecConfigurer serverCodecConfigurer() {
return ServerCodecConfigurer.create();
}
다음과 같이 시도할 수 있습니다.
compile ('org.springframework.cloud:spring-cloud-starter-gateway'){
exclude module : 'spring-cloud-starter'
exclude module : 'spring-boot-starter-webflux'
}
Spring Cloud 버전을 구축할 때도 동일한 문제가 있었습니다.2020.0.0
그리고.Keycloak
보아하니 그것은Keycloak
jar 파일은 다음에 대한 종속성을 포함합니다.spring-boot-start-web
기본값을 포함하지 않도록 Maven에게 지시spring-boot-start-web
다음과 같이 그 문제를 해결했습니다.
<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>
하지만 저는 메이븐에 대한 의존성을 포함시켜야 했습니다.servlet
의 몇 가지 다른 요구 사항을 해결하기 위한 병.Keycloak
다음과 같이:
<dependency>
<groupId>javax.servlet</groupId>
<artifactId>javax.servlet-api</artifactId>
<version>4.0.1</version>
</dependency>
동일한 문제이지만 해결 방법은
@Bean
public ServerCodecConfigurer serverCodecConfigurer() {
return ServerCodecConfigurer.create();
}
문제를 숨기고 응용프로그램을 컴파일합니다.어쨌든 내 게이트웨이가 제대로 작동하지 않게 만들었습니다.에서 정의한 대로 요청해도 전달, 기록 및 응답이 없습니다.yaml
URL. 애플리케이션이 시작된 지 얼마 되지 않았습니다.
나의 경우 문제는spring-boot-start-web
의존.우연히도 저는 그것을 발견하지 못했습니다. 왜냐하면 제 프로젝트 구조에서, 저의build.gradle
"상위"에 의해 상속되고 해당 상위가 구현됨spring-boot-start-web
부차적인
해당 종속성을 제거했고 요청이 올바르게 전달되었으며 로그가 표시되었습니다.내가 제거한 태니@Bean
와 함께ServerCodecConfigurer
.
그것이 같은 상황에 있는 누구에게나 도움이 되기를 바랍니다.
구성: 스프링 부트: 2.4.4
봄구름: 2020.0.2
저에게 문제는 의존성을 추가한 것이었습니다.
<dependency>
<groupId>org.apache.tomcat.embed</groupId>
<artifactId>tomcat-embed-core</artifactId>
<version>10.1.0-M4</version>
</dependency>
Reactive Spring을 사용하는 경우 주의하십시오.나는 필요했습니다.HttpServletRequest
이 의존성에서, 하지만 지금은 사용하고 있습니다.ServerHttpRequest
부터org.springframework.http.server.reactive
.
에서application.properties
파일, 이 속성 설정spring.main.web-application-type=reactive
.
언급URL : https://stackoverflow.com/questions/52447223/bean-of-type-org-springframework-http-codec-servercodecconfigurer-that-could-n
'itsource' 카테고리의 다른 글
Helm을 통해 배포된 Java Spring 부팅 응용 프로그램에서 구성 맵의 속성을 사용하는 방법 (0) | 2023.07.21 |
---|---|
파이썬의 최대공약수 코드 (0) | 2023.07.21 |
AutoConfigureMockMvc 주석에서 secure=false를 무시하는 Spring Boot 통합 테스트에서 401을 얻습니다. (0) | 2023.07.21 |
SpringBoot 구성 요소다중 모듈 프로젝트 스캔 문제 (0) | 2023.07.21 |
두 데이터 프레임을 비교하고 차이점 파악 (0) | 2023.07.21 |