[42] 트러블 슈팅 : Type definition error
- 문제 : 게임방 생성 API test시 Type definition error 발생
- 원인 : domain 생성자를 인식하지 못해서 생기는 에러, @Builder 어노테이션을 사용하고 있는데 생성자를 만들어주는 부분이 없다면 발생할 수 있다. ( 우리 프로젝트의 경우 GameRoom domain 에서 @Builder 를 사용하고 있었다. _
- 해결 : @AllArgsConstructors, @NoargsConstructors 어노테이션 추가
※ 다음은 stackoverflow 에서 해당 에러에 대해 설명되어있는 부분이다.
This could also happen if you are using @Builder from lombok but haven't defined getter/setter neither explicitly nor by @Data as happened in my case, reason being builder uses empty constructor to first create an empty object and then uses setter to set the properties.
[ 참고자료 ]
Spring: Type definition error when posting a new object using a REST service
I have an object which gets two parameters through a json POST request to create a new entry in the database and I get this error: "Type definition error: [simple type, class ffuentese.rest_ex...
stackoverflow.com
https://miinsun.tistory.com/142
[JAVA] Type definition error: Cannot construct instance of 해결 방법
💻 실습 환경 Eclipse JDK 11 📌 원인 : domain의 생성자를 인식하지 못해서 생기는 에러 원래 있던 생성자에 @Builder 어노테이션이 있는데, 어째선지 스프링이 인식하지 못한다. 어쩔 수 없이 새로운
miinsun.tistory.com
https://blog.naver.com/sb2chun/222660832080
[Lombok] @Builder @NoArgsConstructor 관련 에러
@Builder와 @NoArgsConstructor를 같이 쓰면 Error 발생. why? @Builder를 적용하는 것은 @AllArgs...
blog.naver.com