简体   繁体   English

Neo4j没有hello World输出

[英]No hello World output for Neo4j

I am just starting out with Neo4j and this is my first stackoverflow question! 我刚开始使用Neo4j,这是我的第一个stackoverflow问题!

I tried to run the Hello-World example in Eclipse with the user library of Neo4j. 我尝试使用Neo4j的用户库在Eclipse中运行Hello-World示例。 ( https://github.com/neo4j/neo4j/blob/2.2.2/community/embedded-examples/src/main/java/org/neo4j/examples/EmbeddedNeo4j.java ) https://github.com/neo4j/neo4j/blob/2.2.2/community/embedded-examples/src/main/java/org/neo4j/examples/EmbeddedNeo4j.java

I only changed the DB_PATH='data/graph.db' ( because in my neo4j-server.properties : org.neo4j.server.database.location=data/graph.db ) 我只更改了DB_PATH='data/graph.db' (因为在我的neo4j-server.properties中: org.neo4j.server.database.location=data/graph.db

The output I got in the console is: 我在控制台中得到的输出是:

Hello, brave Neo4j World! 您好,勇敢的Neo4j World! Shutting down database ... 关闭数据库...

I shut down the neo4j server using /etc/init.d/neo4j-service stop , then ran eclipse and got the output as provided above.I started the neo4j server again and checked localhost:7474 through the browser. 我使用/etc/init.d/neo4j-service stop关闭neo4j服务器,然后运行eclipse并获得上面提供的输出。我再次启动neo4j服务器并通过浏览器检查localhost:7474。 There were no rows added to the database. 没有添加到数据库的行。

Is there an error in my DB_PATH? 我的DB_PATH是否存在错误? I even tried neoeclipse but did not get any output. 我什至尝试了neoeclipse,但没有得到任何输出。

That example creates and then deletes the data so that is one reason why your graph is empty. 该示例创建然后删除数据,这就是图形为空的原因之一。

Another observation is your DB_PATH . 另一个观察结果是您的DB_PATH If you've set DB_PATH='data/graph.db' , then that path is relative to your project path. 如果您已经设置DB_PATH='data/graph.db' ,那么该路径是相对于您的项目路径的。 If your code is located in /projects/example then this embedded database should be created in /projects/example/data/graph.db 如果您的代码位于/projects/example则应在/projects/example/data/graph.db创建此嵌入式数据库。

If that's the case, then the Neo4j server which is configured to look for the database as org.neo4j.server.database.location=data/graph.db will look for data/graph.db relative to your neo4j installation. 如果是这种情况,那么配置为以org.neo4j.server.database.location=data/graph.db查找数据库的Neo4j服务器将查找相对于neo4j安装的data/graph.db

So you can either fix the path in your code (full path to the db), or change the path in neo4j-server.properties 因此,您可以在代码中修复路径(数据库的完整路径),也可以在neo4j-server.properties更改路径。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM