Redis에 저장된 데이터를 SpringBoot로 불러올 때 서버 에러 발생(ClassCastException, Multiple back reference properties with name 'defaultReference') - bondyuu/dodam GitHub Wiki
Trouble Shooting
Redis Data
Redis에 저장된 데이터는 아래 그림과 같습니다.
Problem 1
Redis에 저장된 데이터를 SpringBoot로 불러올 때 ClassCastException 에러 발생.
Cause of the Problem 1
Jackson은 deserialize할 class에 대한 정보를 충분히 알지 못할 경우 LinkedHashMap을 default(기본값)로 사용해 작업을 수행합니다.
Solution of the Problem 1
ObjectMapper를 활용해 Jakson에게 deserialize할 class에 대한 정보를 알려 주어야 합니다.
Result of the Problem 1
작업이 정상적으로 수행되며 list의 Post 객체에서 Content 값을 반환하는 것을 확인할 수 있습니다.