본문 바로가기
[Programming]/🚀트러블슈팅

[Jackson 에러] com.fasterxml.jackson.databind.exc.InvalidDefinitionException

by 원제트 2023. 10. 11.

문제의 에러 코드

[simple type, class com.mAInd.springboot.domain.surveys.dto.SurveysListResponseDto]; nested exception is com.fasterxml.jackson.databind.exc.InvalidDefinitionException: No serializer found for class com.mAInd.springboot.domain.surveys.dto.SurveysListResponseDto and no properties discovered to create BeanSerializer (to avoid exception, disable SerializationFeature.FAIL_ON_EMPTY_BEANS) (through reference chain: java.util.ArrayList[0]

 

해결방법

 

Dto 위에 @Getter을 선언해주지 않아서 발생한 에러였다

문제가 발생한 SurveysListResponseDto 위에 @Getter를 선언하니 해결되었다