본문 바로가기
Kotlin Spring

Whitelabel Error PageThis application has no explicit mapping for /error, so you are seeing this as a fallback. There was an unexpected error (type=Not Found, status=404) graphql expediagroup 해결하기

by Bill Lab 2024. 11. 29.
728x90

Whitelabel Error PageThis application has no explicit mapping for /error, so you are seeing this as a fallback. There was an unexpected error (type=Not Found, status=404)

 

라는 오류 본적이 있는가?

(흔하게 봤을 것이다.)

일반적인 경우는 쉽게 해결가능하다(말그대로 default page 든 아무것도 없기 때문이다.)

 

하지만, graphql 을 사용하는데, 제대로 세팅한거 같은데 위와 같은 오류가 발생할 경우!???

이를 해결하기 위한 자료가 부족하기 때문에, 꼭 필요한 사람을 위해 글 작성을 해본다.

 

 

위와 같은 오류가 뜨는데, 여러가지 원인이 있겠지만,

일반 SpringMVC를 사용할 경우에는 default page 가 없어서 그러한 것이고(쉽게 해결가능)

 

graphql 을 사용하는데 webflux 기반의 비동기 논블라킹 단일쓰레드로 작업할 경우에는,

주로 expediagroup 에서 제공하는 graphql 을 사용하게 되는데 이때 주의해야할 점이

이 라이브러리는 하단의 Spring MVC에서 돌아가는것이 아닌 webflux 기반에서 최적화 하도록 되어있다.

 

그렇기 때문에 하단의 dependency를 제거하면 끝!!

implementation 'org.springframework.boot:spring-boot-starter-web'

 

자세한 사항은 공식문서를 참고하면 된다.

(이거 잘몰라서 수정실패하여, 다른 graphql 로 갈아탔다는 글도 있더라.)

 

https://opensource.expediagroup.com/graphql-kotlin/docs/server/spring-server/spring-overview/

 

Spring Server Overview | GraphQL Kotlin

graphql-kotlin-spring-server

opensource.expediagroup.com

 

728x90