我遇到的问题是Neo4J-entreprise版本2.2.0RC-01。 我们的一个关系有一个名为Search_Field的属性。 此属性是AutoIndex(在neo4j-server.properties文件中配置)并且是全文(lucene)。 当我们使用与前一个完全相同的值更新此类属性时(例如:Search_Field =' ABC') 当我们这样做时:
START r1=relationship(137)
SET r1.Search_Field = 'ABC'
RETURN r1
发生此错误:
java.lang.Long cannot be cast to org.neo4j.index.impl.lucene.RelationshipId
如果我们更改了值(BCE而不是ABC),它就可以了! 如果我们在节点的属性上也做同样的事情,也就是AutoIndex - 全文 - lucene,它就可以了,没有问题。
是否有人遇到类似的问题?
这是堆栈跟踪:
java.lang.ClassCastException: java.lang.Long cannot be cast to org.neo4j.index.impl.lucene.RelationshipId
at org.neo4j.index.impl.lucene.RelationshipId.equals(RelationshipId.java:43)
at java.util.HashMap.removeEntryForKey(HashMap.java:653)
at java.util.HashMap.remove(HashMap.java:635)
at java.util.HashSet.remove(HashSet.java:233)
at org.neo4j.index.impl.lucene.ExactTxData.remove(ExactTxData.java:157)
at org.neo4j.index.impl.lucene.TxDataHolder.remove(TxDataHolder.java:48)
at org.neo4j.index.impl.lucene.LuceneTransactionState.insert(LuceneTransactionState.java:86)
at org.neo4j.index.impl.lucene.LuceneTransactionState.add(LuceneTransactionState.java:41)
at org.neo4j.index.impl.lucene.LuceneIndex$RelationshipIndex.addRelationship(LuceneIndex.java:425)
at org.neo4j.kernel.impl.api.StateHandlingStatementOperations$3.visit(StateHandlingStatementOperations.java:1379)
at org.neo4j.kernel.impl.api.store.CacheLayer.relationshipVisit(CacheLayer.java:489)
at org.neo4j.kernel.impl.api.StateHandlingStatementOperations.relationshipVisit(StateHandlingStatementOperations.java:1238)
at org.neo4j.kernel.impl.api.StateHandlingStatementOperations.relationshipAddToLegacyIndex(StateHandlingStatementOperations.java:1373)
at org.neo4j.kernel.impl.api.OperationsFacade.relationshipAddToLegacyIndex(OperationsFacade.java:881)
at org.neo4j.kernel.impl.coreapi.LegacyIndexProxy$Type$2.add(LegacyIndexProxy.java:171)
at org.neo4j.kernel.impl.coreapi.LegacyIndexProxy.internalAdd(LegacyIndexProxy.java:524)
at org.neo4j.kernel.impl.coreapi.LegacyIndexProxy.add(LegacyIndexProxy.java:390)
at org.neo4j.kernel.impl.coreapi.AbstractAutoIndexerImpl.propertyChanged(AbstractAutoIndexerImpl.java:70)
at org.neo4j.kernel.impl.api.LegacyPropertyTrackers.relationshipChangeStoreProperty(LegacyPropertyTrackers.java:98)
at org.neo4j.kernel.impl.api.StateHandlingStatementOperations.relationshipSetProperty(StateHandlingStatementOperations.java:648)
at org.neo4j.kernel.impl.api.ConstraintEnforcingEntityOperations.relationshipSetProperty(ConstraintEnforcingEntityOperations.java:171)
at org.neo4j.kernel.impl.api.LockingStatementOperations.relationshipSetProperty(LockingStatementOperations.java:340)
at org.neo4j.kernel.impl.api.OperationsFacade.relationshipSetProperty(OperationsFacade.java:665)
at org.neo4j.cypher.internal.spi.v2_2.TransactionBoundQueryContext$RelationshipOperations.setProperty(TransactionBoundQueryContext.scala:217)
at org.neo4j.cypher.internal.compiler.v2_2.spi.DelegatingOperations.setProperty(DelegatingQueryContext.scala:126)
at org.neo4j.cypher.internal.compatibility.ExceptionTranslatingQueryContext$ExceptionTranslatingOperations.org$neo4j$cypher$internal$compatibility$ExceptionTranslatingQueryContext$ExceptionTranslatingOperations$$super$setProperty(ExceptionTranslatingQueryContext.scala:151)
at org.neo4j.cypher.internal.compatibility.ExceptionTranslatingQueryContext$ExceptionTranslatingOperations$$anonfun$setProperty$1.apply$mcV$sp(ExceptionTranslatingQueryContext.scala:151)
at org.neo4j.cypher.internal.compatibility.ExceptionTranslatingQueryContext$ExceptionTranslatingOperations$$anonfun$setProperty$1.apply(ExceptionTranslatingQueryContext.scala:151)
at org.neo4j.cypher.internal.compatibility.ExceptionTranslatingQueryContext$ExceptionTranslatingOperations$$anonfun$setProperty$1.apply(ExceptionTranslatingQueryContext.scala:151)
at org.neo4j.cypher.internal.compatibility.ExceptionTranslatingQueryContext.org$neo4j$cypher$internal$compatibility$ExceptionTranslatingQueryContext$$translateException(ExceptionTranslatingQueryContext.scala:182)
at org.neo4j.cypher.internal.compatibility.ExceptionTranslatingQueryContext$ExceptionTranslatingOperations.setProperty(ExceptionTranslatingQueryContext.scala:151)
at org.neo4j.cypher.internal.compiler.v2_2.spi.UpdateCountingQueryContext$CountingOps.setProperty(UpdateCountingQueryContext.scala:132)
at org.neo4j.cypher.internal.compiler.v2_2.mutation.PropertySetAction.exec(PropertySetAction.scala:59)
at org.neo4j.cypher.internal.compiler.v2_2.pipes.ExecuteUpdateCommandsPipe.org$neo4j$cypher$internal$compiler$v2_2$pipes$ExecuteUpdateCommandsPipe$$exec(ExecuteUpdateCommandsPipe.scala:56)
at org.neo4j.cypher.internal.compiler.v2_2.pipes.ExecuteUpdateCommandsPi$$$$3fd0ddfab96df657454927b510aaae$$$$ands$1$$anonfun$apply$2.apply(ExecuteUpdateCommandsPipe.scala:45)
at org.neo4j.cypher.internal.compiler.v2_2.pipes.ExecuteUpdateCommandsPi$$$$3fd0ddfab96df657454927b510aaae$$$$ands$1$$anonfun$apply$2.apply(ExecuteUpdateCommandsPipe.scala:45)
at scala.collection.Iterator$$anon$13.hasNext(Iterator.scala:371)
at scala.collection.Iterator$$anon$13.hasNext(Iterator.scala:371)
at scala.collection.Iterator$$anon$11.hasNext(Iterator.scala:327)
at scala.collection.Iterator$$anon$11.hasNext(Iterator.scala:327)
at org.neo4j.cypher.internal.compiler.v2_2.ClosingIterator$$anonfun$hasNext$1.apply$mcZ$sp(ResultIterator.scala:61)
at org.neo4j.cypher.internal.compiler.v2_2.ClosingIterator$$anonfun$hasNext$1.apply(ResultIterator.scala:60)
at org.neo4j.cypher.internal.compiler.v2_2.ClosingIterator$$anonfun$hasNext$1.apply(ResultIterator.scala:60)
at org.neo4j.cypher.internal.compiler.v2_2.ClosingIterator$$anonfun$failIfThrows$1.apply(ResultIterator.scala:120)
at org.neo4j.cypher.internal.compiler.v2_2.ClosingIterator.decoratedCypherException(ResultIterator.scala:129)
at org.neo4j.cypher.internal.compiler.v2_2.ClosingIterator.failIfThrows(ResultIterator.scala:118)
at org.neo4j.cypher.internal.compiler.v2_2.ClosingIterator.hasNext(ResultIterator.scala:59)
at scala.collection.Iterator$class.foreach(Iterator.scala:727)
at org.neo4j.cypher.internal.compiler.v2_2.ClosingIterator.foreach(ResultIterator.scala:49)
at scala.collection.generic.Growable$class.$plus$plus$eq(Growable.scala:48)
at scala.collection.mutable.ListBuffer.$plus$plus$eq(ListBuffer.scala:176)
at scala.collection.mutable.ListBuffer.$plus$plus$eq(ListBuffer.scala:45)
at scala.collection.TraversableOnce$class.to(TraversableOnce.scala:273)
at org.neo4j.cypher.internal.compiler.v2_2.ClosingIterator.to(ResultIterator.scala:49)
at scala.collection.TraversableOnce$class.toList(TraversableOnce.scala:257)
at org.neo4j.cypher.internal.compiler.v2_2.ClosingIterator.toList(ResultIterator.scala:49)
at org.neo4j.cypher.internal.compiler.v2_2.EagerResultIterator.<init>(ResultIterator.scala:35)
at org.neo4j.cypher.internal.compiler.v2_2.ClosingIterator.toEager(ResultIterator.scala:55)
at org.neo4j.cypher.internal.compiler.v2_2.executionplan.DefaultExecutionResultBuilderFactory$ExecutionWorkflowBuilder.buildResultIterator(DefaultExecutionResultBuilderFactory.scala:103)
at org.neo4j.cypher.internal.compiler.v2_2.executionplan.DefaultExecutionResultBuilderFactory$ExecutionWorkflowBuilder.createResults(DefaultExecutionResultBuilderFactory.scala:93)
at org.neo4j.cypher.internal.compiler.v2_2.executionplan.DefaultExecutionResultBuilderFactory$ExecutionWorkflowBuilder.build(DefaultExecutionResultBuilderFactory.scala:64)
at org.neo4j.cypher.internal.compiler.v2_2.executionplan.ExecutionPlanBuilder$$anonfun$getExecutionPlanFunction$1.apply(ExecutionPlanBuilder.scala:122)
at org.neo4j.cypher.internal.compiler.v2_2.executionplan.ExecutionPlanBuilder$$anonfun$getExecutionPlanFunction$1.apply(ExecutionPlanBuilder.scala:106)
at org.neo4j.cypher.internal.compiler.v2_2.executionplan.ExecutionPlanBuilder$$anon$1.run(ExecutionPlanBuilder.scala:70)
at org.neo4j.cypher.internal.compatibility.CompatibilityFor2_2$ExecutionPlanWrapper$$anonfun$run$1.apply(CompatibilityFor2_2.scala:166)
at org.neo4j.cypher.internal.compatibility.CompatibilityFor2_2$ExecutionPlanWrapper$$anonfun$run$1.apply(CompatibilityFor2_2.scala:166)
at org.neo4j.cypher.internal.compatibility.exceptionHandlerFor2_2$.runSafely(CompatibilityFor2_2.scala:104)
at org.neo4j.cypher.internal.compatibility.CompatibilityFor2_2$ExecutionPlanWrapper.run(CompatibilityFor2_2.scala:165)
at org.neo4j.cypher.internal.PreparedPlanExecution.execute(PreparedPlanExecution.scala:27)
at org.neo4j.cypher.ExecutionEngine.execute(ExecutionEngine.scala:107)
at org.neo4j.cypher.ExecutionEngine.execute(ExecutionEngine.scala:101)
at org.neo4j.cypher.javacompat.internal.ServerExecutionEngine.executeQuery(ServerExecutionEngine.java:61)
at org.neo4j.server.rest.transactional.TransactionHandle.executeStatements(TransactionHandle.java:327)
at org.neo4j.server.rest.transactional.TransactionHandle.execute(TransactionHandle.java:258)
at org.neo4j.server.rest.transactional.TransactionHandle.execute(TransactionHandle.java:103)
at org.neo4j.server.rest.web.TransactionalService$1.write(TransactionalService.java:192)
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:302)
at com.sun.jersey.server.impl.application.WebApplicationImpl._handleRequest(WebApplicationImpl.java:1510)
at com.sun.jersey.server.impl.application.WebApplicationImpl.handleRequest(WebApplicationImpl.java:1419)
at com.sun.jersey.server.impl.application.WebApplicationImpl.handleRequest(WebApplicationImpl.java:1409)
at com.sun.jersey.spi.container.servlet.WebComponent.service(WebComponent.java:409)
at com.sun.jersey.spi.container.servlet.ServletContainer.service(ServletContainer.java:540)
at com.sun.jersey.spi.container.servlet.ServletContainer.service(ServletContainer.java:715)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:790)
at org.eclipse.jetty.servlet.ServletHolder.handle(ServletHolder.java:800)
at org.eclipse.jetty.servlet.ServletHandler.doHandle(ServletHandler.java:587)
at org.eclipse.jetty.server.session.SessionHandler.doHandle(SessionHandler.java:221)
at org.eclipse.jetty.server.handler.ContextHandler.doHandle(ContextHandler.java:1125)
at org.eclipse.jetty.servlet.ServletHandler.doScope(ServletHandler.java:515)
at org.eclipse.jetty.server.session.SessionHandler.doScope(SessionHandler.java:185)
at org.eclipse.jetty.server.handler.ContextHandler.doScope(ContextHandler.java:1059)
at org.eclipse.jetty.server.handler.ScopedHandler.handle(ScopedHandler.java:141)
at org.eclipse.jetty.server.handler.HandlerList.handle(HandlerList.java:52)
at org.eclipse.jetty.server.handler.HandlerWrapper.handle(HandlerWrapper.java:97)
at org.eclipse.jetty.server.Server.handle(Server.java:497)
at org.eclipse.jetty.server.HttpChannel.handle(HttpChannel.java:310)
at org.eclipse.jetty.server.HttpConnection.onFillable(HttpConnection.java:248)
at org.eclipse.jetty.io.AbstractConnection$2.run(AbstractConnection.java:540)
at org.eclipse.jetty.util.thread.QueuedThreadPool.runJob(QueuedThreadPool.java:620)
at org.eclipse.jetty.util.thread.QueuedThreadPool$3.run(QueuedThreadPool.java:540)
at java.lang.Thread.run(Thread.java:724)
答案 0 :(得分:0)
我有同样的问题...... :(不能用长值索引关系属性。(发布Neo4j-2.2.0)
解决方法:强>
a)禁用自动索引
b)使用强制转换为字符串更新关系属性:
match ()-[r]-() set r.prop = toString(r.prop);
c)启用自动索引
d)建立关系属性索引:
match ()-[r]-() set r.prop = r.prop;
答案 1 :(得分:-1)
在尝试简单执行时也一样: match() - [n] - ()set n.objectId1 =&#39; a12&#39;
当objectId1上有自动索引时。
java.lang.Long无法强制转换为org.neo4j.index.impl.lucene.RelationshipId Neo.DatabaseError.Statement.ExecutionFailure