我创建了一个运行 Neo4j(社区 AMI)的 AWS EC2 实例,并且我已经通过浏览器成功连接到端点。现在我想通过 Restbinding 从 java 应用程序访问我的数据库
`RestAPI graphDB = new RestAPIFacade("EC2_ENDPOINT:7474/db/data/");
QueryEngine engine=new RestCypherQueryEngine(graphDB);
QueryResult<Map<String,Object>> result = engine.query("start n=node(*) return count(n) as total", Collections.EMPTY_MAP);
Iterator<Map<String, Object>> iterator=result.iterator();
if(iterator.hasNext()) {
Map<String,Object> row= iterator.next();
System.out.print("Total nodes: " + row.get("total")); `
我已经为 localhost 测试了这段代码并得到了结果,但是当我尝试这个时,会发生这个异常!
Exception in thread "main" java.lang.RuntimeException: Error reading as JSON '<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1"/>
<title>Error 404 Not Found</title>
</head>
<body><h2>HTTP ERROR 404</h2>
<p>Problem accessing /db/data/cypher. Reason:
<pre> Not Found</pre></p><hr /><i><small>Powered by Jetty://</small></i><br/>
<br/>
<br/>
<br/>
<br/>
<br/>
<br/>
有人能帮我一下吗。谢谢