본문 바로가기
개발하자/🍃 SpringBoot

[ZEJE] 스프링부트 No serializer found for class ~ and no properties discovered to create BeanSerializer 에러 해결

by 밈밈무 2022. 9. 4.

 

 Servlet.service() for servlet [dispatcherServlet] in context with path [] threw exception [Request processing failed; nested exception is org.springframework.http.converter.HttpMessageConversionException: Type definition error: [simple type, class ewha.efub.zeje.dto.SpotUserResponseDTO]; nested exception is com.fasterxml.jackson.databind.exc.InvalidDefinitionException: No serializer found for class ewha.efub.zeje.dto.SpotUserResponseDTO and no properties discovered to create BeanSerializer (to avoid exception, disable SerializationFeature.FAIL_ON_EMPTY_BEANS) (through reference chain: java.util.ArrayList[0])] with root cause

com.fasterxml.jackson.databind.exc.InvalidDefinitionException: No serializer found for class ewha.efub.zeje.dto.SpotUserResponseDTO 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 붙여서 해결

@Getter
@NoArgsConstructor
public class SpotUserResponseDTO {
	...
}