Finally I need to add the resolver. So I find here an example of implement ObjectIDResolver :import com.fasterxml.jackson.annotation.ObjectIdGenerator;import com.fasterxml.jackson.annotation.ObjectIdResolver;import javax.persistence.EntityManager;/** * @author fta on 20.12.15. */public class EntityIdResolver implements ObjectIdResolver { private EntityManager entityManager; public EntityIdResolver( final EntityManager entityManager) { this.entityManager = entityManager; } @Override public void bindItem( final ObjectIdGenerator.IdKey id, final Object pojo) { } @Override public Object resolveId(final ObjectIdGenerator.IdKey id) { return this.entityManager.find(id.scope, id.key); } @Override public ObjectIdResolver newForDeserialization(final Object context) { return this; } @Override public boolean canUseFor(final ObjectIdResolver resolverType) { return false; }}接下来我添加@JsonIdentityInfo:@Entity@JsonIdentityInfo( generator = ObjectIdGenerators.PropertyGenerator.class, property = "idAgence", resolver = EntityIdResolver.class, scope=Agence.class)public class Agence { // ...} 这篇关于使用 spring 反序列化 JSON:未解决的前向引用 Jackson Exception的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持! 上岸,阿里云!