hrming
[에러] Unrecognized field.. not marked as ignorable 본문
ObjectMapper를 처음 사용하면서, 'Unrecognized field.. not marked as ignorable' 의 에러가 발생했다.
▶ 발생 에러: Unrecognized field.. not marked as ignorable
▶ 에러 원인: Json 데이터를 받아와서 dto 객체로 맵핑할때, dto 클래스에 선언되지 않은 속성이 있을 경우
▶ 해결 방법: new ObjectMapper().configure(DeserializationFeature.FAIL_ON_UNKNOWN_PROPERTIES,false);
(아래 참고한 블로그에, 3개의 해결방법이 있고 나는 위 방법으로 해결했다.)
참고: https://helloworld92.tistory.com/76
자바 Unrecognized field.. not marked as ignorable
에러 : Unrecognized field "ex1" (class ex.extest.dto.response.exResponseDTO), not marked as ignorable json 데이터를 받아와서 dto 객체로 맵핑할때 dto 클래스에 선언되지 않은 속성(ex1)이 json에 있으면 오류가 발생한다.
helloworld92.tistory.com
'기타 > 에러' 카테고리의 다른 글
[에러/Java] missing return statement (0) | 2022.12.10 |
---|---|
[에러] java.util.concurrent.ExecutionException: org.apache.catalina.LifecycleException: (0) | 2022.12.08 |
[에러/Git] 소스코드 충돌로 인해 pull이 안될 때 (0) | 2022.11.17 |
[에러/DB] String or binary data would be truncated (0) | 2022.11.15 |
[에러/Tomcat] Several ports required by Tomcat v8.5 Server at localhost are already in use. (0) | 2022.11.10 |
Comments