【问题标题】:Spring data neo4j fails to connect to neo4j 2.2.1Spring数据neo4j无法连接到neo4j 2.2.1
【发布时间】:2015-05-05 08:38:39
【问题描述】:

我已经在我的新服务器上安装了最新的 neo4j 版本,现在我无法通过 spring data neo4j 连接到服务器。 收到此错误:

    Caused by: org.springframework.beans.factory.BeanDefinitionStoreException: Factory method [public org.springframework.data.neo4j.support.typerepresentation.TypeRepresentationStrategyFactory org.springframework.data.neo4j.config.Neo4jConfiguration.typeRepresentationStrategyFactory() throws java.lang.Exception] threw exception; nested exception is java.lang.RuntimeException: Error reading as JSON ''
    at org.springframework.beans.factory.support.SimpleInstantiationStrategy.instantiate(SimpleInstantiationStrategy.java:188)
    at org.springframework.beans.factory.support.ConstructorResolver.instantiateUsingFactoryMethod(ConstructorResolver.java:590)
    ... 170 more
    Caused by: java.lang.RuntimeException: Error reading as JSON ''
    at org.neo4j.rest.graphdb.util.JsonHelper.readJson(JsonHelper.java:57)
    at org.neo4j.rest.graphdb.util.JsonHelper.jsonToSingleValue(JsonHelper.java:62)
    at org.neo4j.rest.graphdb.RequestResult.toEntity(RequestResult.java:114)
    at org.neo4j.rest.graphdb.RequestResult.toMap(RequestResult.java:120)
    at org.neo4j.rest.graphdb.batch.CypherResult.<init>(CypherResult.java:43)
    at org.neo4j.rest.graphdb.ExecutingRestAPI.query(ExecutingRestAPI.java:548)
    at org.neo4j.rest.graphdb.ExecutingRestAPI.query(ExecutingRestAPI.java:568)
    at org.neo4j.rest.graphdb.RestAPIFacade.query(RestAPIFacade.java:235)
    at org.neo4j.rest.graphdb.query.RestCypherQueryEngine.query(RestCypherQueryEngine.java:50)

问题似乎与杰克逊有关:

Caused by: java.io.EOFException: No content to map to Object due to end of input
at org.codehaus.jackson.map.ObjectMapper._initForReading(ObjectMapper.java:2768)
at org.codehaus.jackson.map.ObjectMapper._readMapAndClose(ObjectMapper.java:2711)

我尝试升级到最新的驱动程序 2.2.1,但没有帮助。 我使用的版本是:

<neo4j.version>2.2.1</neo4j.version>
<spring-data-neo4j>3.2.1.RELEASE</spring-data-neo4j>
<spring-data-commons>1.9.1.RELEASE</spring-data-commons>

有没有办法让它与新发布的 neo4j 服务器一起工作?

【问题讨论】:

    标签: java neo4j spring-data-neo4j


    【解决方案1】:

    您应该至少使用 SDN 3.3.0.RELEASE,它应该适用于服务器,但不适用于嵌入式。

    【讨论】:

    • 谢谢,但我仍然得到同样的错误 neo4j.version is 2.2.1, spring-data-neo4j 3.3.0.RELEASE 和 spring-data-commons is 1.10.0.RELEASE
    • 我遇到了同样的错误......它在 Neo4J 2.1.6 和 SDN 3.0.5(我知道这是旧的......)上工作得很好,并且遇到了这个问题......感谢任何帮助
    【解决方案2】:

    我想我遇到了类似的问题,我被告知 SDN 3.3.0.RELEASE 与 Neo4J 2.2.1 不兼容。需要等待SDN 4.0,这里有迁移手册在写进度:http://docs.spring.io/spring-data/neo4j/docs/4.0.0.M1/reference/html/#migration

    【讨论】:

    • 您可以尝试4.0.BUILD-SNAPSHOT版本,正在开发中。但是您需要迁移您的代码,并且不确定它是否可以工作。
    • 这里是 Neo4j 的官方回答:stackoverflow.com/a/30323760/1349585
    猜你喜欢
    • 2015-08-12
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多