在执行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
exectuting时的例外情况 -
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>
答案 0 :(得分:2)
问题出现在neo4j 1.8.2中。升级到1.9RC1修复了这个问题 谢谢大家的回复。
答案 1 :(得分:0)
你可以尝试在shell中运行它,看看关系类型COLLABORATES_WITH
是否出现两次?
eval db.getRelationshipTypes()