This repository was archived by the owner on Mar 15, 2025. It is now read-only.
cannot deserialize from Object value (no delegate- or property-based Creator) #992
Answered
by
sangwonsheep
sangwonsheep
asked this question in
이슈 / 버그
-
에러 발생 상황RabbitMQ Listener에서 LinkCrawlingEvent를 읽어올 때 해당 에러가 발생합니다. Caused by: com.fasterxml.jackson.databind.exc.MismatchedInputException: Cannot construct instance of `baguni.common.event.events.LinkCrawlingEvent` (although at least one Creator exists):
cannot deserialize from Object value (no delegate- or property-based Creator) at [Source: REDACTED (`StreamReadFeature.INCLUDE_SOURCE_IN_LOCATION` disabled); line: 1, column: 2] /**
* 필드가 1개인 경우 cannot deserialize from Object value (no delegate- or property-based Creator) 발생
*/
@Getter
public class LinkCrawlingEvent extends Event {
private final String url;
public LinkCrawlingEvent(String url) {
this.url = url;
}
} 변수(필드)가 여러 개인 Event들에서는 발생하지 않는 것으로 예상됩니다. 해결책
/**
* 필드가 1개인 경우 cannot deserialize from Object value (no delegate- or property-based Creator) 발생
*/
@Getter
@NoArgsConstructor(access = AccessLevel.PROTECTED)
public class LinkCrawlingEvent extends Event {
private String url;
public LinkCrawlingEvent(String url) {
this.url = url;
}
} 참고 사이트 |
Beta Was this translation helpful? Give feedback.
Answered by
sangwonsheep
Jan 20, 2025
Replies: 2 comments
-
Beta Was this translation helpful? Give feedback.
0 replies
Answer selected by
kimminkyeu
-
정리 감사합니다! 내일 확인해볼깨유! |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
@kimminkyeu 해당 내용 알고 있으면 좋을 것 같아요!
Jackson이 멤버 변수 1개인 경우와 여러 개인 경우의 동작 방식이 어떻게 다른지 찾아보면 좋을 것 같습니다!
https://yo00ong.tistory.com/67
https://velog.io/@conatuseus/RequestBody%EC%97%90-%EC%99%9C-%EA%B8%B0%EB%B3%B8-%EC%83%9D%EC%84%B1%EC%9E%90%EB%8A%94-%ED%95%84%EC%9A%94%ED%95%98%EA%B3%A0-Setter%EB%8A%94-%ED%95%84%EC%9A%94-%EC%97%86%EC%9D%84%EA%B9%8C-3-idnrafiw#%EC%96%B4%EB%96%BB%EA%B2%8C-objectmapper%EA%B0%80-json-field%EC%99%80-java-field%EB%A5%BC-%EB%A7%A4%EC%B9%AD%EC%8B%9C%ED%82%AC%EA%B9%8C