2014-02-18 128 views
0

我跑春季数据Neo4j的版本2.3.3创建未闭合的括号例外。当我尝试通过我的GraphRepository执行CREATE语句,我得到以下异常:在弹簧数据的Neo4j

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}),我也得到了相同的结果。

编辑:我尝试升级我的聚甲醛使用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 '[email protected]' 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是我的控制器我的GraphRepository

回答

2

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

+0

有趣。我只是尝试升级我的POM使用3.0.0,现在我得到了一个不同的例外。请参阅我的编辑。 – drewmoore

+0

如果您是从同一商店开始的,则需要设置选项以允许升级。 –