以下是我的pom.xml中的依赖项
<dependency>
<groupId>io.spring.platform</groupId>
<artifactId>platform-bom</artifactId>
<!--<version>1.1.4.RELEASE</version> -->
<version>2.0.7.RELEASE</version>
<type>pom</type>
<scope>import</scope>
</dependency>
<dependency>
<!-- Import dependency management from Spring Boot -->
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-dependencies</artifactId>
<version>1.4.0.RELEASE</version>
<!--<version>1.2.7.RELEASE</version> -->
<type>pom</type>
<scope>import</scope>
</dependency>
<dependency>
<groupId>org.springframework.data</groupId>
<artifactId>spring-data-releasetrain</artifactId>
<version>Hopper-SR2</version>
<type>pom</type>
<scope>import</scope>
</dependency>
<dependency>
<groupId>org.springframework.data</groupId>
<artifactId>spring-data-neo4j</artifactId>
<version>4.1.0.RC1</version>
</dependency>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-data-jpa</artifactId>
</dependency>
以及许多其他依赖项
我的应用程序使用内存 - 德比(嵌入式配置文件)/ MySQL(远程配置文件)进行事务数据存储,使用Neo4j图形数据库来处理分层数据存储。我的要求是根据maven配置文件在远程和嵌入模式下运行Neo4j。默认情况下,spring版本管理器使用旧版本的Spring-data-neo4j(3.x.x),但嵌入式Neo4j支持仅在4.0.0版之后可用。当我使用上面显示的配置构建我的应用程序时,我收到一个错误,如下所示,
// ...exception stacktrace
Caused by: org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'locationRepository': Invocation of init method failed; nested exception is java.lang.AbstractMethodError
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.initializeBean(AbstractAutowireCapableBeanFactory.java:1578)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:545)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:482)
at org.springframework.beans.factory.support.AbstractBeanFactory$1.getObject(AbstractBeanFactory.java:306)
at org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton(DefaultSingletonBeanRegistry.java:230)
at org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:302)
at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:197)
at org.springframework.beans.factory.support.DefaultListableBeanFactory.findAutowireCandidates(DefaultListableBeanFactory.java:1192)
at org.springframework.beans.factory.support.DefaultListableBeanFactory.doResolveDependency(DefaultListableBeanFactory.java:1116)
at org.springframework.beans.factory.support.DefaultListableBeanFactory.resolveDependency(DefaultListableBeanFactory.java:1014)
at org.springframework.beans.factory.annotation.AutowiredAnnotationBeanPostProcessor$AutowiredFieldElement.inject(AutowiredAnnotationBeanPostProcessor.java:545)
... 57 common frames omitted
Caused by: java.lang.AbstractMethodError: null
at org.springframework.data.repository.core.support.RepositoryFactorySupport$QueryExecutorMethodInterceptor.<init>(RepositoryFactorySupport.java:416)
at org.springframework.data.repository.core.support.RepositoryFactorySupport.getRepository(RepositoryFactorySupport.java:206)
at org.springframework.data.repository.core.support.RepositoryFactoryBeanSupport.initAndReturn(RepositoryFactoryBeanSupport.java:251)
at org.springframework.data.repository.core.support.RepositoryFactoryBeanSupport.afterPropertiesSet(RepositoryFactoryBeanSupport.java:237)
at org.springframework.data.neo4j.repository.support.GraphRepositoryFactoryBean.afterPropertiesSet(GraphRepositoryFactoryBean.java:43)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.invokeInitMethods(AbstractAutowireCapableBeanFactory.java:1637)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.initializeBean(AbstractAutowireCapableBeanFactory.java:1574)
... 67 common frames omitted
我猜这个错误是因为Spring-data-commons的冲突版本。有没有办法解决这个错误?
答案 0 :(得分:0)
Hopper-SR2支持Spring-data-neo4j 4.1.2。你为什么要降级到4.1.0.RC1?尝试删除降级或明确将其设置为4.1.2。
如果您仍然认为自己正在获得3.x版本,请运行以下内容并查看3.x版本中的内容。
mvn dependency:tree -Dverbose -Dincludes=spring-data-neo4j
您可以使用相同的过程来查找与spring-data-commons的冲突。只需更改include参数(或省略所有依赖项)。如果发现冲突,请在pom.xml中明确包含正确的版本。