Could not convert the JSON data from Java Object: Map [id=sun.reflect.DelegatingConstructorAccessorImpl.newInstance] com.fasterxml.jackson.databind.JsonMappingException: No serializer found for class DTO클래스 and no properties discovered to create BeanSerializer (to avoid exception, disable SerializationFeature.FAIL_ON_EMPTY_BEANS) (through reference chain: 블라블라블라

자.. 이게 뭐 이유는 obj 의 json 화의 실패이고, 막는 방법은.. 다양...까지는 아니지만 몇가지가 있다. 찾으면 바로 나온다.

단, 내가 mapper 를 설정할 수 있는 상황이 아니라면... obj -> json 으로 할때 처리할 수 있도록 해서 이 에러를 피할수 있다.

즉 해당 dto 에 final 로 의미없는 값 하나를 정의하고 getter 까지 선언해두면(어차피 final 이라서 set 안됨) 그 먹이(?)로 인해 json 파싱에러없이 잘 나온다. 아주 간단한 해결책이다. 

 

+ Recent posts