getRelationships()上neo4j IndexOutOfBoundsException的原因

时间:2015-09-29 14:30:52

标签: neo4j

这发生在neo4j版本2.3.0-M02

为什么这个代码......

Iterable<Relationship> rels = node.getRelationships( ... any various args ... );
for (Relationship rel : rels) {
    // Some computation
}

...导致这个堆栈跟踪?

Caused by: java.lang.IndexOutOfBoundsException
    at org.neo4j.io.pagecache.impl.muninn.MuninnPageCursor.setOffset(MuninnPageCursor.java:410)
    at org.neo4j.kernel.impl.store.RelationshipGroupStore.getRecord(RelationshipGroupStore.java:117)
    at org.neo4j.kernel.impl.store.RelationshipGroupStore.getRecord(RelationshipGroupStore.java:77)
    at org.neo4j.kernel.impl.api.StoreRelationshipIterable$DenseIterator.<init>(StoreRelationshipIterable.java:214)
    at org.neo4j.kernel.impl.api.StoreRelationshipIterable.iterator(StoreRelationshipIterable.java:96)
    at org.neo4j.kernel.impl.api.StoreRelationshipIterable.iterator(StoreRelationshipIterable.java:76)
    at org.neo4j.kernel.impl.api.store.DiskLayer.nodeListRelationships(DiskLayer.java:241)
    at org.neo4j.kernel.impl.api.store.CacheLayer.nodeListRelationships(CacheLayer.java:424)
    at org.neo4j.kernel.impl.api.StateHandlingStatementOperations.nodeGetRelationships(StateHandlingStatementOperations.java:925)
    at org.neo4j.kernel.impl.api.StateHandlingStatementOperations.nodeGetRelationships(StateHandlingStatementOperations.java:933)
    at org.neo4j.kernel.impl.api.ConstraintEnforcingEntityOperations.nodeGetRelationships(ConstraintEnforcingEntityOperations.java:426)
    at org.neo4j.kernel.impl.api.OperationsFacade.nodeGetRelationships(OperationsFacade.java:361)
    at org.neo4j.kernel.impl.core.NodeProxy$2.iterator(NodeProxy.java:194)
    at org.neo4j.kernel.impl.core.NodeProxy$2.iterator(NodeProxy.java:186)

更新

1 个答案:

答案 0 :(得分:1)

您应该升级到Neo4j 2.3.0-M03。

里程碑版本往往不稳定,你使用旧版本。众所周知,M02有缺陷,很多都是固定在M03中。

因此,请升级并检查这是否适合您。