spring-data-neo4j中CREATE上的Unclosed括号异常

时间:2014-02-18 04:33:58

标签: java spring neo4j cypher spring-data-neo4j

我正在运行Spring Data Neo4j 2.3.3版。当我尝试通过GraphRepository执行CREATE语句时,我遇到以下异常:

org.springframework.dao.InvalidDataAccessResourceUsageException: Error executing statement ...  nested exception is Unclosed parenthesis
"CREATE (:line{id:1})-[:ROOT]->(:point{id:10})-[:NEXT]->(:point{id:11})-[:NEXT]->(:point{id:12})-[:NEXT]->(p:point{id:13})"
         ^

...仅隐藏在其下方打印的相同内容,^出现在正确的位置。正如您所看到的,如果您查看我的查询,则没有未公开的括号。这里发生了什么?

编辑: 出于测试目的,我尝试将语句缩减为:CREATE (:line{id:1}),并得到相同的结果。

编辑: 我尝试升级我的pom以使用版本3.0.0,现在我遇到以下异常:

 Error creating bean with name 'controller': Injection of autowired dependencies failed; nested exception is org.springframework.beans.factory.BeanCreationException: Could not autowire field: org.example.model.LineRepo org.example.controller.Controller.lineRepo; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'lineRepo': Cannot resolve reference to bean 'neo4jTemplate' while setting bean property 'neo4jTemplate'; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'org.springframework.data.neo4j.config.Neo4jConfiguration#0': Cannot resolve reference to bean 'graphDatabaseService' while setting bean property 'graphDatabaseService'; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'graphDatabaseService' defined in ServletContext resource [/WEB-INF/dispatcher-servlet.xml]: Instantiation of bean failed; nested exception is org.springframework.beans.BeanInstantiationException: Could not instantiate bean class [org.neo4j.kernel.EmbeddedGraphDatabase]: Constructor threw exception; nested exception is java.lang.RuntimeException: org.neo4j.kernel.lifecycle.LifecycleException: Component 'org.neo4j.kernel.extension.KernelExtensions@61634a3b' failed to initialize. Please see attached cause exception.

给出的最深层根本原因是:

java.lang.NoSuchMethodError: org.neo4j.kernel.impl.nioneo.store.FileSystemAbstraction.getOrCreateThirdPartyFileSystem(Ljava/lang/Class;Lorg/neo4j/helpers/Function;)Lorg/neo4j/kernel/impl/nioneo/store/FileSystemAbstraction$ThirdPartyFileSystem;

除了升级依赖项之外,没有任何改变。它所引用的'controller' bean是我@Autowired的{​​{1}}控制器

1 个答案:

答案 0 :(得分:2)

Spring Data Neo4j 2.3.3适用于Neo4j 1.9,它不支持标签(您在Cypher中使用的语法)。您需要使用3.0.0才能获得Neo4j 2.0支持。