我有一个spring boot应用程序,它可以休息调用neo4j。我正在使用以下maven依赖 -
<dependency>
<groupId>org.springframework.data</groupId>
<artifactId>spring-data-neo4j-rest</artifactId>
<version>3.3.0.RELEASE</version>
</dependency>
<dependency>
<groupId>org.springframework.data</groupId>
<artifactId>spring-data-neo4j</artifactId>
<version>3.3.0.RELEASE</version>
</dependency>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-data-rest</artifactId>
</dependency>
<dependency>
<groupId>org.hibernate</groupId>
<artifactId>hibernate-validator</artifactId>
</dependency>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-test</artifactId>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.springframework.data</groupId>
<artifactId>spring-data-commons</artifactId>
<version>1.10.2.RELEASE</version>
</dependency>
使用Neo4j 2.2.3,Rest App工作正常。在我将Neo4j升级到2.3.3之后,Rest App并未工作。我得到了依赖性问题。 Maven无法下载Neo4j 2.3.3 jar,即使我尝试使用spring-data-neo4j-rest(3.4.4.RELEASE)和spring-data-neo4j(4.0.0.RELEASE)的最新版本的工件。 请告诉我用于Neo4j 2.3.3的spring-data-neo4j-rest和spring-data-neo4j的工件版本。 这是我得到的错误 -
org.springframework.context.ApplicationContextException: Unable to start embedded container; nested exception is org.springframework.boot.context.embedded.EmbeddedServletContainerException: Unable to start embedded Tomcat
at org.springframework.boot.context.embedded.EmbeddedWebApplicationContext.onRefresh(EmbeddedWebApplicationContext.java:133)
at org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:474)
at org.springframework.boot.context.embedded.EmbeddedWebApplicationContext.refresh(EmbeddedWebApplicationContext.java:118)
at org.springframework.boot.SpringApplication.refresh(SpringApplication.java:686)
at org.springframework.boot.SpringApplication.run(SpringApplication.java:320)
at org.springframework.boot.SpringApplication.run(SpringApplication.java:957)
at org.springframework.boot.SpringApplication.run(SpringApplication.java:946)
at com.tpgsi.marvin.graph.neo4j.SampleGraphApp.main(SampleGraphApp.java:37)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:497)
at org.springframework.boot.maven.RunMojo$LaunchRunner.run(RunMojo.java:418)
at java.lang.Thread.run(Thread.java:745)
at org.springframework.boot.context.embedded.EmbeddedWebApplicationContext.createEmbeddedServletContainer(EmbeddedWebApplicationContext.java:157)
at org.springframework.boot.context.embedded.EmbeddedWebApplicationContext.onRefresh(EmbeddedWebApplicationContext.java:130)
Caused by: org.springframework.beans.BeanInstantiationException: Failed to instantiate [org.springframework.data.neo4j.core.TypeRepresentationStrategy]: Factory method 'nodeTypeRepresentationStrategy' threw exception; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'typeRepresentationStrategyFactory' defined in class com.tpgsi.marvin.graph.neo4j.Neo4jAppConfiguration: Bean instantiation via factory method failed; nested exception is org.springframework.beans.BeanInstantiationException: Failed to instantiate [org.springframework.data.neo4j.support.typerepresentation.TypeRepresentationStrategyFactory]: Factory method 'typeRepresentationStrategyFactory' threw exception; nested exception is java.lang.RuntimeException: Error reading as JSON ''
at org.springframework.beans.factory.support.SimpleInstantiationStrategy.instantiate(SimpleInstantiationStrategy.java:189)
at org.springframework.beans.factory.support.ConstructorResolver.instantiateUsingFactoryMethod(ConstructorResolver.java:588)
Caused by: org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'typeRepresentationStrategyFactory' defined in class com.tpgsi.marvin.graph.neo4j.Neo4jAppConfiguration: Bean instantiation via factory method failed; nested exception is org.springframework.beans.BeanInstantiationException: Failed to instantiate [org.springframework.data.neo4j.support.typerepresentation.TypeRepresentationStrategyFactory]: Factory method 'typeRepresentationStrategyFactory' threw exception; nested exception is java.lang.RuntimeException: Error reading as JSON ''
at org.springframework.beans.factory.support.ConstructorResolver.instantiateUsingFactoryMethod(ConstructorResolver.java:599)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.instantiateUsingFactoryMethod(AbstractAutowireCapableBeanFactory.java:1119)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBeanInstance(AbstractAutowireCapableBeanFactory.java:1014)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:504)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:476)
at org.springframework.beans.factory.support.AbstractBeanFactory$1.getObject(AbstractBeanFactory.java:303)
at org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton(DefaultSingletonBeanRegistry.java:230)
at org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:299)
at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:194)
at org.springframework.context.annotation.ConfigurationClassEnhancer$BeanMethodInterceptor.intercept(ConfigurationClassEnhancer.java:322)
at com.tpgsi.marvin.graph.neo4j.Neo4jAppConfiguration$$EnhancerBySpringCGLIB$$41e66ef0.typeRepresentationStrategyFactory(<generated>)
at org.springframework.data.neo4j.config.Neo4jConfiguration.nodeTypeRepresentationStrategy(Neo4jConfiguration.java:146)
at com.tpgsi.marvin.graph.neo4j.Neo4jAppConfiguration$$EnhancerBySpringCGLIB$$41e66ef0.CGLIB$nodeTypeRepresentationStrategy$8(<generated>)
at com.tpgsi.marvin.graph.neo4j.Neo4jAppConfiguration$$EnhancerBySpringCGLIB$$41e66ef0$$FastClassBySpringCGLIB$$f1f67914.invoke(<generated>)
at org.springframework.cglib.proxy.MethodProxy.invokeSuper(MethodProxy.java:228)
at org.springframework.context.annotation.ConfigurationClassEnhancer$BeanMethodInterceptor.intercept(ConfigurationClassEnhancer.java:309)
at com.tpgsi.marvin.graph.neo4j.Neo4jAppConfiguration$$EnhancerBySpringCGLIB$$41e66ef0.nodeTypeRepresentationStrategy(<generated>)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:497)
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:104)
at org.neo4j.rest.graphdb.RequestResult.toMap(RequestResult.java:113)
at org.neo4j.rest.graphdb.query.CypherRestResult.<init>(CypherRestResult.java:36)
at org.neo4j.rest.graphdb.RestAPIImpl.query(RestAPIImpl.java:756)
at org.neo4j.rest.graphdb.RestAPIImpl.query(RestAPIImpl.java:796)
at org.neo4j.rest.graphdb.query.RestCypherQueryEngine.query(RestCypherQueryEngine.java:50)
at org.springframework.data.neo4j.rest.SpringRestCypherQueryEngine.query(SpringRestCypherQueryEngine.java:48)
at org.springframework.data.neo4j.support.ReferenceNodes.executeQuery(ReferenceNodes.java:75)
at org.springframework.data.neo4j.support.ReferenceNodes.getReferenceNode(ReferenceNodes.java:79)
at org.springframework.data.neo4j.support.typerepresentation.SubReferenceNodeTypeRepresentationStrategy.isStrategyAlreadyInUse(SubReferenceNodeTypeRepresentationStrategy.java:95)
at org.springframework.data.neo4j.support.typerepresentation.TypeRepresentationStrategyFactory.chooseStrategy(TypeRepresentationStrategyFactory.java:52)
at org.springframework.data.neo4j.support.typerepresentation.TypeRepresentationStrategyFactory.<init>(TypeRepresentationStrategyFactory.java:35)
at org.springframework.data.neo4j.config.Neo4jConfiguration.typeRepresentationStrategyFactory(Neo4jConfiguration.java:151)
at com.tpgsi.marvin.graph.neo4j.Neo4jAppConfiguration$$EnhancerBySpringCGLIB$$41e66ef0.CGLIB$typeRepresentationStrategyFactory$2(<generated>)
at com.tpgsi.marvin.graph.neo4j.Neo4jAppConfiguration$$EnhancerBySpringCGLIB$$41e66ef0$$FastClassBySpringCGLIB$$f1f67914.invoke(<generated>)
at org.springframework.cglib.proxy.MethodProxy.invokeSuper(MethodProxy.java:228)
at org.springframework.context.annotation.ConfigurationClassEnhancer$BeanMethodInterceptor.intercept(ConfigurationClassEnhancer.java:309)
at com.tpgsi.marvin.graph.neo4j.Neo4jAppConfiguration$$EnhancerBySpringCGLIB$$41e66ef0.typeRepresentationStrategyFactory(<generated>)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:497)
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:2775)
at org.codehaus.jackson.map.ObjectMapper._readMapAndClose(ObjectMapper.java:2718)
at org.codehaus.jackson.map.ObjectMapper.readValue(ObjectMapper.java:1863)