gpt4 book ai didi

java - Spring Neo4J REST 错误 - nodeStateTransmitter

转载 作者:行者123 更新时间:2023-11-30 03:58:09 25 4
gpt4 key购买 nike

我一直在尝试运行这个简单的示例(使用 java 1.7)https://github.com/spring-guides/gs-accessing-neo4j-data-rest/tree/master/complete

尝试通过 Application 类中的 main 方法启动应用程序时,我不断收到以下错误。

我将整个日志上传到此要点:http://bit.ly/1hU7Vpu

这是错误的摘要。

WARN 6470 --- [           main] o.s.boot.SpringApplication               : Error handling failed (Error creating bean with name 'org.springframework.data.rest.webmvc.config.RepositoryRestMvcConfiguration': Initialization of bean failed; nested exception is java.lang.NoSuchMethodError: org.springframework.data.rest.webmvc.config.RepositoryRestMvcConfiguration.setBeanFactory(Lorg/springframework/beans/factory/BeanFactory;)V)
Exception in thread "main" org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'entityFetchHandler' defined in class hello.Application: Instantiation of bean failed; nested exception is org.springframework.beans.factory.BeanDefinitionStoreException: Factory method [public org.springframework.data.neo4j.support.mapping.Neo4jEntityFetchHandler org.springframework.data.neo4j.config.Neo4jConfiguration.entityFetchHandler() throws java.lang.Exception] threw exception; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'nodeStateTransmitter' defined in class hello.Application: Initialization of bean failed; nested exception is java.lang.reflect.MalformedParameterizedTypeException

最佳答案

我认为您遇到了 Spring 版本冲突。请参阅错误日志中的以下行:

exception is java.lang.NoSuchMethodError: org.springframework.data.rest.webmvc.config.RepositoryRestMvcConfiguration.setBeanFactory(Lorg/springframework/beans/factory/BeanFactory;)V)

您应该能够通过删除以下行来防止此错误(您可能根本不需要它):

@Import(RepositoryRestMvcConfiguration.class)

你能显示mvn dependency:tree的输出吗?您的类路径上可能有重复的 Spring 库。

编辑:

看来是 SDN 的快照版本导致了该问题。使用

<dependency>
<groupId>org.springframework.data</groupId>
<artifactId>spring-data-neo4j</artifactId>
<version>3.0.1.RELEASE</version>
</dependency>

而不是

<dependency>
<groupId>org.springframework.data</groupId>
<artifactId>spring-data-neo4j</artifactId>
<version>3.1.0.BUILD-SNAPSHOT</version>
</dependency>

您可能发现了一个错误!

关于java - Spring Neo4J REST 错误 - nodeStateTransmitter,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/22600920/

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