1. エラー内容
jacksonで、
以下のように
実装記述
ObjectMapper mapper = new ObjectMapper(); Show show = mapper.readValue(json, Show.class);
エラー内容
java.lang.RuntimeException: com.fasterxml.jackson.databind.JsonMappingException: No suitable constructor found for type [simple type, class xyz.monotalk.social.mixcloud.data.Show]: can not instantiate from JSON object (missing default constructor or creator, or perhaps need to add/enable type information?)
2. 原因
引数なしの
修正前の
データクラスの 記述 /** * Show * * @author Kem */ @Getter @Setter @AllArgsConstructor @Builder @ToString public class Show extends Response { private String description; }
修正後の
データクラスの 記述
以下に変更する ことで 解決しました。 /** * Show * * @author Kem */ @Getter @Setter @AllArgsConstructor @Builder @ToString public class Show extends Response { public Show() { super(); } private String description; }
以上です。
コメント