나의 Error 기록

Susan·2022년 10월 13일
0

Join을 진행한 테이블을 Mapping 테이블에 추가하는 코드에서,

cannot deserialize from object value (no delegate- or property-based creator)

이라는 에러가 발생했다.

검색결과,

jackson library가 빈 생성자가 없는 모델을 생성하는 방법을 모른다는 결과를 얻음..

Solution

Entity, 혹은 해당 데이터를 받는 Dto에 따로 빈 생성자를 추가해 주어야 함.

//Getter, Setter는 생략
public class Member {
	private int id;
	private String username;
	private String password;
	private String email;

//기본 생성자 추가
public Member() {

}

public Member(int id, String username, String password, String email) {
    this.id = id;
    this.username = username;
    this.password = password;
    this.email = email;
}

}

profile
열공하자!

0개의 댓글