0

を使用してjava.lang.StackOverflowErrorをしながら、StackOverflowErrorがSpringDataとElasticsearch - I単純な関係(春データelasticsearch)が、springbootを使用していますignoreFields

@Document(indexName = "users", type = "user") 
public class User { 
    @Id 
    private String id; 

    @Field(type= FieldType.Nested,ignoreFields={"users"}) 
    private Set<Group> groups = new HashSet<Group>(); 
} 

@Document(indexName = "groups", type = "group") 
public class Group { 

    @Id 
    String id; 

    @Field(type = FieldType.Nested, ignoreFields ={"groups"}) 
    private Set<User> users = new HashSet<User>(); 
} 

public interface UserRepository extends ElasticsearchRepository<User, String>{ 

} 

public interface GroupRepository extends ElasticsearchRepository<Group, String> { 

} 

問題は何である任意のアイデアを投げていますか?春ブートがにStackOverflowErrorを投げている:あなたが言ったように

コードはhttps://github.com/spring-projects/spring-data-elasticsearch/tree/master/src/test/java/org/springframework/data/elasticsearch/entities

おかげ ラジャン

答えて

0

からです。

これは、スプリングブートで安全対策や循環依存を検出していないためです。春・ブートソースで

ルック:MappingBuilder.javaは、あなたが@Field注釈参照クラスA.

を持って @Field注釈参照クラスBを、持っているクラスAを持っていたときに壊れることはありませんループがあります
関連する問題