Warning: file_get_contents(/data/phpspider/zhask/data//catemap/7/neo4j/3.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
REST api与Neo4j 2.1.1的批处理错误_Neo4j - Fatal编程技术网

REST api与Neo4j 2.1.1的批处理错误

REST api与Neo4j 2.1.1的批处理错误,neo4j,Neo4j,在Debian wheezy实例上,我刚刚将我的独立Neo4j服务器从2.0.2版迁移到2.1.1版(我在java-7-openjdk-amd64上运行)。由于我在REST api上遇到批量查询问题: 在空数据库上,我尝试了以下测试: 首先,我创建了一个节点: curl -H Accept:application/json -H Content-Type:application/json -X POST -d '{"name":"Steven"}' http://localhost:7474/

在Debian wheezy实例上,我刚刚将我的独立Neo4j服务器从2.0.2版迁移到2.1.1版(我在java-7-openjdk-amd64上运行)。由于我在REST api上遇到批量查询问题:

在空数据库上,我尝试了以下测试:

  • 首先,我创建了一个节点:

    curl -H Accept:application/json -H Content-Type:application/json -X POST -d '{"name":"Steven"}' http://localhost:7474/db/data/node
    
已成功创建节点:

    {
      "extensions" : {
      },
      "paged_traverse" : "http://localhost:7474/db/data/node/0/paged/traverse/{returnType}{?pageSize,leaseTime}",
      "labels" : "http://localhost:7474/db/data/node/0/labels",
      "outgoing_relationships" : "http://localhost:7474/db/data/node/0/relationships/out",
      "traverse" : "http://localhost:7474/db/data/node/0/traverse/{returnType}",
      "all_typed_relationships" : "http://localhost:7474/db/data/node/0/relationships/all/{-list|&|types}",
      "property" : "http://localhost:7474/db/data/node/0/properties/{key}",
      "all_relationships" : "http://localhost:7474/db/data/node/0/relationships/all",
      "self" : "http://localhost:7474/db/data/node/0",
      "outgoing_typed_relationships" : "http://localhost:7474/db/data/node/0/relationships/out/{-list|&|types}",
      "properties" : "http://localhost:7474/db/data/node/0/properties",
      "incoming_relationships" : "http://localhost:7474/db/data/node/0/relationships/in",
      "incoming_typed_relationships" : "http://localhost:7474/db/data/node/0/relationships/in/{-list|&|types}",
      "create_relationship" : "http://localhost:7474/db/data/node/0/relationships",
      "data" : {
        "name" : "Steven"
    }
  • 然后我尝试获取新节点:

    curl -H Accept:application/json -H Content-Type:application/json -X GET http://localhost:7474/db/data/node/0
    
这给了我预期的结果:

    {
      "extensions" : {
      },
      "paged_traverse" : "http://localhost:7474/db/data/node/0/paged/traverse/{returnType}{?pageSize,leaseTime}",
      "labels" : "http://localhost:7474/db/data/node/0/labels",
      "outgoing_relationships" : "http://localhost:7474/db/data/node/0/relationships/out",
      "traverse" : "http://localhost:7474/db/data/node/0/traverse/{returnType}",
      "all_typed_relationships" : "http://localhost:7474/db/data/node/0/relationships/all/{-list|&|types}",
      "property" : "http://localhost:7474/db/data/node/0/properties/{key}",
      "all_relationships" : "http://localhost:7474/db/data/node/0/relationships/all",
      "self" : "http://localhost:7474/db/data/node/0",
      "outgoing_typed_relationships" : "http://localhost:7474/db/data/node/0/relationships/out/{-list|&|types}",
      "properties" : "http://localhost:7474/db/data/node/0/properties",
      "incoming_relationships" : "http://localhost:7474/db/data/node/0/relationships/in",
      "incoming_typed_relationships" : "http://localhost:7474/db/data/node/0/relationships/in/{-list|&|types}",
      "create_relationship" : "http://localhost:7474/db/data/node/0/relationships",
      "data" : {
        "name" : "Steven"
    }
  • 但是同一批请求给了我以下错误

    curl -H Accept:application/json -H Content-Type:application/json -X POST -d '[{"method":"GET","to":"/node/0","id":0}]' http://localhost:7474/db/data/batch
    
    {
      "exception" : "NullPointerException",
      "fullname" : "java.lang.NullPointerException",
      "stacktrace" : [ "org.neo4j.server.web.Jetty9WebServer.invokeDirectly(Jetty9WebServer.java:339)", "org.neo4j.server.rest.batch.NonStreamingBatchOperations.invoke(NonStreamingBatchOperations.java:55)", "org.neo4j.server.rest.batch.BatchOperations.performRequest(BatchOperations.java:201)", "org.neo4j.server.rest.batch.BatchOperations.parseAndPerform(BatchOperations.java:171)", "org.neo4j.server.rest.batch.NonStreamingBatchOperations.performBatchJobs(NonStreamingBatchOperations.java:48)", "org.neo4j.server.rest.web.BatchOperationService.batchProcess(BatchOperationService.java:126)", "org.neo4j.server.rest.web.BatchOperationService.performBatchOperations(BatchOperationService.java:76)", "java.lang.reflect.Method.invoke(Method.java:606)", "org.neo4j.server.rest.transactional.TransactionalRequestDispatcher.dispatch(TransactionalRequestDispatcher.java:139)", "java.lang.Thread.run(Thread.java:744)"]
    
我看到的唯一日志是http日志:

127.0.0.1--[03/Jun/2014:14:56:17+0200]“POST/db/data/node HTTP/1.1”201 1160“-”curl/7.26.0” 127.0.0.1--[03/Jun/2014:14:56:33+0200]“GET/db/data/node/0http/1.1”200 1160“-”curl/7.26.0” 127.0.0.1--[03/Jun/2014:14:56:47+0200]“POST/db/data/batch HTTP/1.1“500 1000”-“curl/7.26.0”

任何帮助都将不胜感激

多谢各位

编辑:流模式下的完全相同的请求(即,标题X-Stream设置为true)具有不同的行为:它提供预期的数据,但状态为500

curl -H X-Stream:true -H Accept:application/json -H Content-Type:application/json -X POST -d '[{"method":"GET","to":"/node/0","id":0}]' http://localhost:7474/db/data/batch

[
  {
    "id":0,
    "from":"/node/0",
    "body":
      {
        "extensions":{},
        "paged_traverse":"http://localhost:7474/db/data/node/0/paged/traverse/{returnType}{?pageSize,leaseTime}",
        "labels":"http://localhost:7474/db/data/node/0/labels",
        "outgoing_relationships":"http://localhost:7474/db/data/node/0/relationships/out",
        "traverse":"http://localhost:7474/db/data/node/0/traverse/{returnType}",
        "all_typed_relationships":"http://localhost:7474/db/data/node/0/relationships/all/{-list|&|types}",
        "property":"http://localhost:7474/db/data/node/0/properties/{key}",
        "all_relationships":"http://localhost:7474/db/data/node/0/relationships/all",
        "self":"http://localhost:7474/db/data/node/0",
        "properties":"http://localhost:7474/db/data/node/0/properties",
        "outgoing_typed_relationships":"http://localhost:7474/db/data/node/0/relationships/out/{-list|&|types}",
        "incoming_relationships":"http://localhost:7474/db/data/node/0/relationships/in",
        "incoming_typed_relationships":"http://localhost:7474/db/data/node/0/relationships/in/{-list|&|types}",
        "create_relationship":"http://localhost:7474/db/data/node/0/relationships",
        "data":
          {
            "name":"Steven"
          }
      },
    "status":500
  }
]

我正在与@benito de la casita合作,Neo4J 2.1.1上的请求与此完全相同,它是通过MacOS X MavericksA上的自制程序安装的。为此,已创建了一个适当的版本: