我已经在我的新服务器上安装了最新的neo4j版本,现在我无法通过spring数据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服务器一起使用?
答案 0 :(得分:0)
至少应该使用SDN 3.3.0.RELEASE,它应该与Server配合使用,但它不适用于嵌入式。
答案 1 :(得分:0)
我想我遇到过类似的问题,我被告知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