반응형
Kotlin 에서 @InitBinder 를 사용할 때,
API 가 실행되는 시점에 InitBinder 함수가 실행되며,
@InitBinder methods must not return a value (should be void):
에러가 발생했습니다.
분명,
@ControllerAdvice
class GlobalControllerAdvice {
@InitBinder
fun initBinder(binder: WebDataBinder){
}
}
위와 같이 return 을 없는 것으로 처리를 했는데도 return 이 void 가 아니라고 되어있는데,
이는,
@ControllerAdvice
class GlobalControllerAdvice {
@InitBinder
fun initBinder(binder: WebDataBinder) : Unit? {
return null
}
}
위와 같이 명시적으로 return 값을 null 로 반환해주면 해결됩니다.
반응형
'Error Note' 카테고리의 다른 글
| Python Fastapi FormData alias is not working 2025-04-22 (0) | 2025.04.22 |
|---|---|
| Docker failed: port is already allocated. 에러 발생 (0) | 2024.09.29 |
| docker compose 에서 network_mode: "host" 설정 시 local 에서 접근 불가. (0) | 2024.09.29 |
| Springboot Gradle 빌드시, java.lang.IllegalStateException: Module entity with name 에러 발생 (0) | 2023.08.30 |
| SourceTree Git 여러 계정 사용하기 (SSH) (0) | 2023.08.30 |