私は Neo4J の初心者であり、neo4j Web サイト ( http://docs.neo4j.org/chunked/milestone/tutorials-java-embedded-hello-world.html ) の HelloWorld チュートリアルに従っています。
私の目的は、2 つのノードとそれらの間の関係を作成し、最終的に次の方法でアクセスできるダッシュボードでこれを観察することです。
[http://localhost:7474/webadmin/#]
しかし問題は、コードを実行するとエラーが発生し、それを解決する方法がわからないことです。
どんな助けでも本当に感謝します
どうもありがとうございました
ここに私のコードとエラーがあります
コード
import org.neo4j.graphdb.GraphDatabaseService;
import org.neo4j.graphdb.Node;
import org.neo4j.graphdb.Relationship;
import org.neo4j.graphdb.RelationshipType;
import org.neo4j.graphdb.Transaction;
import org.neo4j.graphdb.factory.GraphDatabaseFactory;
public class HelloNeo4J {
private static enum RelTypes implements RelationshipType
{
KNOWS
}
public static String DB_PATH= " /home/anas/graph/data/graph.db/" ;
public static void main ( String[] args){
GraphDatabaseService graphDb= new GraphDatabaseFactory().newEmbeddedDatabase( DB_PATH );
Node firstNode, secondNode;
Relationship relationship;
Transaction tx = graphDb.beginTx();
try
{
firstNode = graphDb.createNode();
firstNode.setProperty( "message", "Hello, " );
secondNode = graphDb.createNode();
secondNode.setProperty( "message", "World!" );
relationship = firstNode.createRelationshipTo( secondNode, RelTypes.KNOWS );
relationship.setProperty( "message", "brave Neo4j " );
tx.success();
}
finally
{
tx.finish();
}
}
}
エラー
Exception in thread "main" org.neo4j.kernel.lifecycle.LifecycleException: Failed to transition org.neo4j.kernel.AbstractGraphDatabase$DefaultKernelExtensionLoader@691f36 from NONE to STOPPED
at org.neo4j.kernel.lifecycle.LifeSupport$LifecycleInstance.init(LifeSupport.java:388)
at org.neo4j.kernel.lifecycle.LifeSupport.init(LifeSupport.java:82)
at org.neo4j.kernel.lifecycle.LifeSupport.start(LifeSupport.java:116)
at org.neo4j.kernel.AbstractGraphDatabase.run(AbstractGraphDatabase.java:224)
at org.neo4j.kernel.EmbeddedGraphDatabase.<init>(EmbeddedGraphDatabase.java:79)
at org.neo4j.graphdb.factory.GraphDatabaseFactory$1.newDatabase(GraphDatabaseFactory.java:70)
at org.neo4j.graphdb.factory.GraphDatabaseBuilder.newGraphDatabase(GraphDatabaseBuilder.java:195)
at org.neo4j.graphdb.factory.GraphDatabaseFactory.newEmbeddedDatabase(GraphDatabaseFactory.java:56)
at HelloNeo4J.main(HelloNeo4J.java:20)
Caused by: java.lang.VerifyError: class org.neo4j.kernel.InternalAbstractGraphDatabase overrides final method getStoreDir.()Ljava/lang/String;
at java.lang.ClassLoader.defineClass1(Native Method)
at java.lang.ClassLoader.defineClass(ClassLoader.java:634)
at java.security.SecureClassLoader.defineClass(SecureClassLoader.java:142)
at java.net.URLClassLoader.defineClass(URLClassLoader.java:277)
at java.net.URLClassLoader.access$000(URLClassLoader.java:73)
at java.net.URLClassLoader$1.run(URLClassLoader.java:212)
at java.security.AccessController.doPrivileged(Native Method)
at java.net.URLClassLoader.findClass(URLClassLoader.java:205)
at java.lang.ClassLoader.loadClass(ClassLoader.java:321)
at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:294)
at java.lang.ClassLoader.loadClass(ClassLoader.java:266)
at org.neo4j.index.lucene.LuceneIndexProvider.load(LuceneIndexProvider.java:65)
at org.neo4j.kernel.AbstractGraphDatabase$DefaultKernelExtensionLoader.loadIndexImplementations(AbstractGraphDatabase.java:1180)
at org.neo4j.kernel.AbstractGraphDatabase$DefaultKernelExtensionLoader.init(AbstractGraphDatabase.java:1152)
at org.neo4j.kernel.lifecycle.LifeSupport$LifecycleInstance.init(LifeSupport.java:382)
... 8 more