일 | 월 | 화 | 수 | 목 | 금 | 토 |
---|---|---|---|---|---|---|
1 | 2 | 3 | 4 | |||
5 | 6 | 7 | 8 | 9 | 10 | 11 |
12 | 13 | 14 | 15 | 16 | 17 | 18 |
19 | 20 | 21 | 22 | 23 | 24 | 25 |
26 | 27 | 28 | 29 | 30 | 31 |
Tags
- JPA
- ReactJS
- Design Patterns
- MySQL
- 맛집
- 요리
- jenkins
- AWS
- Gradle
- ubuntu
- jsp
- php
- Spring Boot
- javascript
- IntelliJ
- java
- Web Server
- linux
- laravel
- docker
- it
- db
- Spring
- springboot
- Oracle
- redis
- devops
- tool
- Git
- elasticsearch
Archives
- Today
- Total
아무거나
Error: no Creators, like default construct, exist... 본문
반응형
Error: no Creators, like default construct, exist... (JSON을 파싱한 결과를 전달할 적절한 생성자를 찾지 못했을 때 발생하는 에러)
- 생성자로 JSON 속성값을 전달하는 방법
import com.fasterxml.jackson.annotation.JsonCreator; import com.fasterxml.jackson.annotation.JsonProperty; import lombok.Getter; @Getter public class AccessLog { private final String title; private final String ip; private final String username; @JsonCreator public TestDTO( @JsonProperty("title") String title, @JsonProperty("ip") String ip, @JsonProperty("username") String username ) { this.accessDateTime = accessDateTime; this.ip = ip; this.username = username; } }
반응형
'Java > Java' 카테고리의 다른 글
Java 의 Optional 개념과 올바르게 사용하는 방법 (0) | 2022.07.22 |
---|---|
JDBC 동작과정 (0) | 2022.01.07 |
Annotation 설명 및 실습 (0) | 2021.05.05 |
리플렉션(Reflection) 이란? (0) | 2021.05.03 |
Java에서 Apache OpenOffice + JODConverter 를 활용한 PDF Converter 개발 (2) | 2020.06.17 |
Comments