[英]Spring Neo4J REST error - nodeStateTransmitter
I've been trying to get this simple example running (with java 1.7) https://github.com/spring-guides/gs-accessing-neo4j-data-rest/tree/master/complete 我一直在尝试运行这个简单的示例(使用Java 1.7) https://github.com/spring-guides/gs-accessing-neo4j-data-rest/tree/master/complete
I keep getting the following error when attempting to start the application via the main method in the Application class. 尝试通过Application类中的main方法启动应用程序时,始终收到以下错误。
I'uploaded the entire log to this gist: http://bit.ly/1hU7Vpu 我已将整个日志上传到该要点: http ://bit.ly/1hU7Vpu
Here's the summary of the error. 这是错误的摘要。
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
I think that you are seeing a Spring version conflict. 我认为您看到的是Spring版本冲突。 See the following line in your error log: 请参阅错误日志中的以下行:
exception is java.lang.NoSuchMethodError: org.springframework.data.rest.webmvc.config.RepositoryRestMvcConfiguration.setBeanFactory(Lorg/springframework/beans/factory/BeanFactory;)V)
You should be able to prevent this error by removing the following line (you might not need it anyway): 您应该可以通过删除以下行来防止发生此错误(无论如何您可能都不需要它):
@Import(RepositoryRestMvcConfiguration.class)
Can you show the output of mvn dependency:tree
? 您可以显示mvn dependency:tree
的输出吗? There might be duplicate Spring libs on your classpath. 您的类路径上可能有重复的Spring库。
EDIT: 编辑:
It appears that it's the snapshot release of SDN that's causing the issue. 造成问题的原因似乎是SDN的快照版本。 Use 采用
<dependency>
<groupId>org.springframework.data</groupId>
<artifactId>spring-data-neo4j</artifactId>
<version>3.0.1.RELEASE</version>
</dependency>
instead of 代替
<dependency>
<groupId>org.springframework.data</groupId>
<artifactId>spring-data-neo4j</artifactId>
<version>3.1.0.BUILD-SNAPSHOT</version>
</dependency>
You might have found a bug! 您可能发现了一个错误!
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.