2016-05-13 1 views
0

私はNeo4jとスプリングデータで作業を開始しています。neo4j spring data認識できないフィールド "meta"

私はデータベースを取得できますが、セットを作成することはできません。

保存メソッドを使用しようとすると、このエラーが発生します。それはジャックソンによる認識されていない分野のためと思われる。私は解決策を探したが、何も働かなかった。

誰も私を助けることができますか?

10:52:49.481 [http-nio-8080-exec-2] INFO o.s.d.n.config.Neo4jConfiguration - Initialising Neo4jSession 
10:52:51.617 [http-nio-8080-exec-2] ERROR o.n.o.s.response.RowModelResponse - failed to parse: {"row":[1],"meta":[null]}]} 
10:52:51.694 [http-nio-8080-exec-2] INFO o.s.d.n.config.Neo4jConfiguration - Intercepted exception 
May 13, 2016 10:52:56 AM org.apache.catalina.core.StandardWrapperValve invoke 
SEVERE: Servlet.service() for servlet [DispatcherServlet] in context with path [/ProjetoExemplo] threw exception [Request processing failed; nested exception is java.lang.RuntimeException: com.fasterxml.jackson.databind.exc.UnrecognizedPropertyException: Unrecognized field "meta" (class org.neo4j.ogm.session.result.RowModelResult), not marked as ignorable (one known property: "row"]) 
at [Source: {"row":[1],"meta":[null]}]}; line: 1, column: 20] (through reference chain: org.neo4j.ogm.session.result.RowModelResult["meta"])] with root cause 
com.fasterxml.jackson.databind.exc.UnrecognizedPropertyException: Unrecognized field "meta" (class org.neo4j.ogm.session.result.RowModelResult), not marked as ignorable (one known property: "row"]) 
at [Source: {"row":[1],"meta":[null]}]}; line: 1, column: 20] (through reference chain: org.neo4j.ogm.session.result.RowModelResult["meta"]) 
    at com.fasterxml.jackson.databind.exc.UnrecognizedPropertyException.from(UnrecognizedPropertyException.java:51) 
    at com.fasterxml.jackson.databind.DeserializationContext.reportUnknownProperty(DeserializationContext.java:731) 
    at com.fasterxml.jackson.databind.deser.std.StdDeserializer.handleUnknownProperty(StdDeserializer.java:915) 
    at com.fasterxml.jackson.databind.deser.BeanDeserializerBase.handleUnknownProperty(BeanDeserializerBase.java:1292) 
    at com.fasterxml.jackson.databind.deser.BeanDeserializerBase.handleUnknownVanilla(BeanDeserializerBase.java:1270) 
    at com.fasterxml.jackson.databind.deser.BeanDeserializer.vanillaDeserialize(BeanDeserializer.java:247) 
    at com.fasterxml.jackson.databind.deser.BeanDeserializer.deserialize(BeanDeserializer.java:118) 
    at com.fasterxml.jackson.databind.ObjectMapper._readMapAndClose(ObjectMapper.java:3051) 
    at com.fasterxml.jackson.databind.ObjectMapper.readValue(ObjectMapper.java:2146) 
    at org.neo4j.ogm.session.response.RowModelResponse.next(RowModelResponse.java:45) 
    at org.neo4j.ogm.session.response.SessionResponseHandler.updateObjects(SessionResponseHandler.java:93) 
    at org.neo4j.ogm.session.delegates.SaveDelegate.save(SaveDelegate.java:69) 
    at org.neo4j.ogm.session.delegates.SaveDelegate.save(SaveDelegate.java:43) 
    at org.neo4j.ogm.session.Neo4jSession.save(Neo4jSession.java:386) 

私のクラス:

@NodeEntity 
@JsonIgnoreProperties(ignoreUnknown = true) 
public class Teste { 

@JsonProperty("id") 
private Long id; 

public Long getId() { 
    return id; 
} 

private String name; 

public Teste(){ 

} 

public String getName() { 
    return name; 
} 

public void setName(String name) { 
    this.name = name; 
} 

@Override 
public int hashCode() { 
    final int prime = 31; 
    int result = 1; 
    result = prime * result + ((id == null) ? 0 : id.hashCode()); 
    return result; 
} 

@Override 
public boolean equals(Object obj) { 
    if (this == obj) 
     return true; 
    if (obj == null) 
     return false; 
    if (getClass() != obj.getClass()) 
     return false; 
    Teste other = (Teste) obj; 
    if (id == null) { 
     if (other.id != null) 
      return false; 
    } else if (!id.equals(other.id)) 
     return false; 
    return true; 
} 

マイコール:あなたはのNeo4j 3を使用しているよう

Teste teste1 = new Teste(); 
    teste1.setName("TESTE");   
    testeService.save(teste1); 

答えて

1

が見えますか?その場合、使用しているSDNのバージョンは互換性がないと思われます。 のNeo4j 3.0は、これらと互換性がある:

  • SDN 4.2の現在のスナップショット:4.2.0.BUILD-SNAPSHOT
  • SDN 4.1.1:のNeo4j-OGMと4.1.1.RELEASE 2.0.2
+0

ありがとう@ルアン、問題はバージョンでした。 Neo4J 4.2.4にneo4j-ogm 2.0.2を入れて解決しました。 – Camila

+0

@Luane私はパッケージを取得していません:spring-data-neo4jへのアップグレード後にorg.neo4j.helpers:4.1.2.RELEASE。このパッケージが新しいバージョンで破棄された場合、IteratorUtilをどのように使用するのですか? –

関連する問題