1

在执行 neo4jClient 调用期间会引发以下异常。neo4jClient 团队告诉我这是一个 neo4j 问题。所以我把这个贴在这里,希望有一个解决方案。

例外情况在下面发布。从数据浏览器执行 Cypher 查询时,我也收到无效查询。有了这个 -

START n=node(84), n1=node(86)
MATCH n-[r:COLLABORATES_WITH]-n1
RETURN r

无效查询

但是,这有效-

START n=node(84), n1=node(86)
MATCH n-[r:COLLABORATES_WITH*1]-n1
RETURN r

执行时的异常 -

        var results = _client.Cypher
        .Start(new { n1 = (NodeReference)fromId, n2 = (NodeReference)toId })
        .Match("n1-[r:" + relationshipTypeKey + "]->n2")

        .Return<RelationshipInstance<vRelationship>>("r")
        .Results;

执行请求时收到意外的 HTTP 状态。

查询是:

START n1=node({p0}), n2=node({p1})
MATCH n1-[r:COLLABORATES_WITH]->n2
RETURN r

响应状态为:500 开发人员:Andres 声称:遇到意外的遍历状态

Neo4j 的回应(可能包括有用的细节!)是:

<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1"/>
<title>Error 500 Developer: Andres claims that: Unexpected traversal state     encountered</title>

</head>
<body><h2>HTTP ERROR 500</h2>
<p>Problem accessing /db/data/cypher. Reason:
Developer: Andres claims that: Unexpected traversal state encountered</pre></p><h3>

造成的:

</h3><pre>org.neo4j.helpers.ThisShouldNotHappenError: Developer: Andres claims that: Unexpected traversal state encountered
at org.neo4j.cypher.internal.pipes.matching.BidirectionalTraversalMatcher$StepCollisionDetector.includePath(BidirectionalTraversalMatcher.scala:101)
at org.neo4j.kernel.StandardBranchCollisionDetector.evaluate(StandardBranchCollisionDetector.java:74)
at org.neo4j.kernel.StandardBranchCollisionDetector.evaluate(StandardBranchCollisionDetector.java:37)
at org.neo4j.kernel.impl.traversal.BidirectionalTraverserIterator.fetchNextOrNull(BidirectionalTraverserIterator.java:157)
at org.neo4j.kernel.impl.traversal.BidirectionalTraverserIterator.fetchNextOrNull(BidirectionalTraverserIterator.java:41)
at org.neo4j.helpers.collection.PrefetchingIterator.hasNext(PrefetchingIterator.java:55)
at scala.collection.JavaConversions$JIteratorWrapper.hasNext(JavaConversions.scala:574)
at scala.collection.Iterator$$anon$21.hasNext(Iterator.scala:371)
at scala.collection.Iterator$$anon$21.hasNext(Iterator.scala:371)
at scala.collection.Iterator$$anon$19.hasNext(Iterator.scala:334)
at scala.collection.Iterator$$anon$19.hasNext(Iterator.scala:334)
at org.neo4j.cypher.PipeExecutionResult.hasNext(PipeExecutionResult.scala:138)
at scala.collection.Iterator$$anon$19.hasNext(Iterator.scala:334)
at scala.collection.JavaConversions$IteratorWrapper.hasNext(JavaConversions.scala:562)
at org.neo4j.helpers.collection.ExceptionHandlingIterable$1.hasNext(ExceptionHandlingIterable.java:59)
at org.neo4j.helpers.collection.IteratorWrapper.hasNext(IteratorWrapper.java:42)
at org.neo4j.server.rest.repr.ListRepresentation.serialize(ListRepresentation.java:58)
at org.neo4j.server.rest.repr.Serializer.serialize(Serializer.java:75)
at org.neo4j.server.rest.repr.MappingSerializer.putList(MappingSerializer.java:61)
at org.neo4j.server.rest.repr.CypherResultRepresentation.serialize(CypherResultRepresentation.java:50)
at org.neo4j.server.rest.repr.MappingRepresentation.serialize(MappingRepresentation.java:42)
at org.neo4j.server.rest.repr.OutputFormat$1.write(OutputFormat.java:133)
at com.sun.jersey.core.impl.provider.entity.StreamingOutputProvider.writeTo(StreamingOutputProvider.java:71)
at com.sun.jersey.core.impl.provider.entity.StreamingOutputProvider.writeTo(StreamingOutputProvider.java:57)
at com.sun.jersey.spi.container.ContainerResponse.write(ContainerResponse.java:306)
at com.sun.jersey.server.impl.application.WebApplicationImpl._handleRequest(WebApplicationImpl.java:1437)
at com.sun.jersey.server.impl.application.WebApplicationImpl.handleRequest(WebApplicationImpl.java:1349)
at com.sun.jersey.server.impl.application.WebApplicationImpl.handleRequest(WebApplicationImpl.java:1339)
at com.sun.jersey.spi.container.servlet.WebComponent.service(WebComponent.java:416)
at com.sun.jersey.spi.container.servlet.ServletContainer.service(ServletContainer.java:537)
at com.sun.jersey.spi.container.servlet.ServletContainer.service(ServletContainer.java:699)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:820)
at org.mortbay.jetty.servlet.ServletHolder.handle(ServletHolder.java:511)
at org.mortbay.jetty.servlet.ServletHandler.handle(ServletHandler.java:390)
at org.mortbay.jetty.servlet.SessionHandler.handle(SessionHandler.java:182)
at org.mortbay.jetty.handler.ContextHandler.handle(ContextHandler.java:765)
at org.mortbay.jetty.handler.HandlerCollection.handle(HandlerCollection.java:114)
at org.mortbay.jetty.handler.HandlerWrapper.handle(HandlerWrapper.java:152)
at org.mortbay.jetty.Server.handle(Server.java:326)
at org.mortbay.jetty.HttpConnection.handleRequest(HttpConnection.java:542)
at org.mortbay.jetty.HttpConnection$RequestHandler.content(HttpConnection.java:943)
at org.mortbay.jetty.HttpParser.parseNext(HttpParser.java:756)
at org.mortbay.jetty.HttpParser.parseAvailable(HttpParser.java:212)
at org.mortbay.jetty.HttpConnection.handle(HttpConnection.java:404)
at org.mortbay.io.nio.SelectChannelEndPoint.run(SelectChannelEndPoint.java:410)
at org.mortbay.thread.QueuedThreadPool$PoolThread.run(QueuedThreadPool.java:582)


<hr /><i><small>Powered by Jetty://</small></i><br/>                                                


</body>

</html>
4

2 回答 2

2

该问题发生在 neo4j 1.8.2 中。升级到 1.9RC1 解决了这个问题。
谢谢大家的回复。

于 2013-04-29T08:46:35.910 回答
0

您可以尝试在 shell 中运行它并查看关系类型是否COLLABORATES_WITH出现两次?

eval db.getRelationshipTypes()

于 2013-04-28T22:13:46.390 回答