gpt4 book ai didi

java - spring-data-neo4j 中 CREATE 未闭括号异常

转载 作者:行者123 更新时间:2023-12-02 06:11:24 25 4
gpt4 key购买 nike

我正在运行 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 和我的 GraphRepository

的 Controller

最佳答案

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

关于java - spring-data-neo4j 中 CREATE 未闭括号异常,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/21844455/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com