2014-04-09 2 views
1

자바에서 노드와 관계를 만들었습니다. 그 값은 DB에서 나오므로 동적으로 할당됩니다.자바에서 Neo4j 관계를 생성하는 중 오류가 발생했습니다.

"java.lang.AbstractMethodError: org.neo4j.graphdb.index.IndexProvider.load(Lorg/neo4j/graphdb/DependencyResolver;)Lorg/neo4j/graphdb/index/IndexImplementation; at org.neo4j.graphdb.index.IndexProviderKernelExtensionFactory$IndexProviderKernelExtension.start(IndexProviderKernelExtensionFactory.java:72) 
     at org.neo4j.kernel.lifecycle.LifeSupport$LifecycleInstance.start(LifeSupport.java:498)" 

가이드하십시오 -

GraphDatabaseService graphDb= new GraphDatabaseFactory().newEmbeddedDatabase("D://MyGraph); 
//Data access logic Code here 
............. 
while(rs.next()) 
{ 
    String node1= rs.getString("App_Name"); 
    String rel = rs.getString("Interface_Name"); 
    String node2= rs.getString("Corresponding_App"); 
    Transaction tx=graphDb.beginTx();  
    try{   
     RelationshipType rel1 =DynamicRelationshipType.withName(rel);      
     Node nodeName1 = graphDb.createNode(); 
     Node nodeName2 = graphDb.createNode();     
     nodeName1.addLabel(DynamicLabel.label((node1)));      
     nodeName1.setProperty("name", (node1)); 
     nodeName2.addLabel(DynamicLabel.label((node2)));      
     nodeName2.setProperty("name", (node2)); 
     nodeName1.createRelationshipTo(nodeName2, rel1); 
     tx.success(); 
     ... 
    } 
    ... 
} 

그러나 나는 오류를 얻고있다.

+0

종속성 관리에 maven을 사용합니까? 그렇다면,'mvn dependency : tree'의 결과를 제공하십시오. 그렇지 않으면 Stefan이 제안한대로 수동으로 라이브러리 목록을 제공하십시오. – tstorms

답변

1

Stefan이 이미 제안했듯이, jar 파일과 버전이 충돌합니다. 의존성을 관리하기 위해 maven 또는 gradle을 사용하는 것이 좋습니다. Neo4j 2.0.1에는 프로젝트에 수동으로 추가하려는 경우를 대비해 다음과 같은 종속성이 있습니다.

[INFO] \- org.neo4j:neo4j:jar:2.0.1:compile 
[INFO] +- org.neo4j:neo4j-kernel:jar:2.0.1:compile 
[INFO] | \- org.apache.geronimo.specs:geronimo-jta_1.1_spec:jar:1.1.1:compile 
[INFO] +- org.neo4j:neo4j-lucene-index:jar:2.0.1:compile 
[INFO] | \- org.apache.lucene:lucene-core:jar:3.6.2:compile 
[INFO] +- org.neo4j:neo4j-graph-algo:jar:2.0.1:compile 
[INFO] +- org.neo4j:neo4j-udc:jar:2.0.1:compile 
[INFO] +- org.neo4j:neo4j-graph-matching:jar:2.0.1:compile 
[INFO] +- org.neo4j:neo4j-cypher:jar:2.0.1:compile 
[INFO] | +- org.neo4j:neo4j-cypher-commons:jar:2.0.1:compile 
[INFO] | +- org.neo4j:neo4j-cypher-compiler-1.9:jar:2.0.1:compile 
[INFO] | +- org.neo4j:neo4j-cypher-compiler-2.0:jar:2.0.1:compile 
[INFO] | | \- org.parboiled:parboiled-scala_2.10:jar:1.1.6:compile 
[INFO] | |  \- org.parboiled:parboiled-core:jar:1.1.6:compile 
[INFO] | +- com.googlecode.concurrentlinkedhashmap:concurrentlinkedhashmap-lru:jar:1.3.1:compile 
[INFO] | \- org.scala-lang:scala-library:jar:2.10.3:compile 
[INFO] \- org.neo4j:neo4j-jmx:jar:2.0.1:compile 
0

이것은 클래스 경로에 Neo4j의 혼합 버전이있는 것 같습니다. 모든 Neo4j jar가 동일한 버전으로 사용되는지, 클래스 패스에 중복 된 jar가없고 모든 의존성이 제자리에 있는지 확인하십시오.

추가 도움이 필요하면 여기에 현재 클래스 경로 설정을 첨부하십시오.

관련 문제