Spring/Spring err

[Spring] JPA FetchType.LAZY 시 JSON에러

민돌v 2022. 3. 23. 17:58

com.fasterxml.jackson.databind.exc.InvalidDefinitionException: No serializer found for class org.hibernate.proxy.pojo.bytebuddy.ByteBuddyInterceptor and no properties discovered to create BeanSerializer (to avoid exception, disable SerializationFeature.FAIL_ON_EMPTY_BEANS)

com.fasterxml.jackson.databind.exc.InvalidDefinitionException: No serializer found for class org.hibernate.proxy.pojo.bytebuddy.ByteBuddyInterceptor and no properties discovered to create BeanSerializer (to avoid exception, disable SerializationFeature.FAIL_ON_EMPTY_BEANS) (through reference chain: java.util.ArrayList[0]->com.example.marumaru_sparta_verspring.domain.profile.Profile["user"]->com.example.marumaru_sparta_verspring.domain.user.User$HibernateProxy$eCWm7iWg["hibernateLazyInitializer"])
	at com.fasterxml.jackson.databind.exc.InvalidDefinitionException.from(InvalidDefinitionException.java:77) ~[jackson-databind-2.12.5.jar:2.12.5]

 

 

Lazy때린

순환참조된 객체에, @Jsoniognore 추가하기