簡體   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