繁体   English   中英

Spring Neo4J REST错误-nodeStateTransmitter

[英]Spring Neo4J REST error - nodeStateTransmitter

我一直在尝试运行这个简单的示例(使用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>

您可能发现了一个错误!

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM