title: Maven dependency version conflict: Application using Spring data Neo4j and Spring data JPA
body: <p>Here are the dependencies in my pom.xml,</p>
  
  <pre><code>    &lt;dependency&gt;
          &lt;groupId&gt;io.spring.platform&lt;/groupId&gt;
          &lt;artifactId&gt;platform-bom&lt;/artifactId&gt;
          &lt;!--&lt;version&gt;1.1.4.RELEASE&lt;/version&gt; --&gt;
          &lt;version&gt;2.0.7.RELEASE&lt;/version&gt;
          &lt;type&gt;pom&lt;/type&gt;
          &lt;scope&gt;import&lt;/scope&gt;
      &lt;/dependency&gt;
      &lt;dependency&gt;
          &lt;!-- Import dependency management from Spring Boot --&gt;
          &lt;groupId&gt;org.springframework.boot&lt;/groupId&gt;
          &lt;artifactId&gt;spring-boot-dependencies&lt;/artifactId&gt;
          &lt;version&gt;1.4.0.RELEASE&lt;/version&gt;
          &lt;!--&lt;version&gt;1.2.7.RELEASE&lt;/version&gt; --&gt;
          &lt;type&gt;pom&lt;/type&gt;
          &lt;scope&gt;import&lt;/scope&gt;
      &lt;/dependency&gt;
  
      &lt;dependency&gt;
          &lt;groupId&gt;org.springframework.data&lt;/groupId&gt;
          &lt;artifactId&gt;spring-data-releasetrain&lt;/artifactId&gt;
          &lt;version&gt;Hopper-SR2&lt;/version&gt;
          &lt;type&gt;pom&lt;/type&gt;
          &lt;scope&gt;import&lt;/scope&gt;
      &lt;/dependency&gt;
  
      &lt;dependency&gt;
          &lt;groupId&gt;org.springframework.data&lt;/groupId&gt;
          &lt;artifactId&gt;spring-data-neo4j&lt;/artifactId&gt;
          &lt;version&gt;4.1.0.RC1&lt;/version&gt;
      &lt;/dependency&gt;
  
      &lt;dependency&gt;
          &lt;groupId&gt;org.springframework.boot&lt;/groupId&gt;
          &lt;artifactId&gt;spring-boot-starter-data-jpa&lt;/artifactId&gt;
      &lt;/dependency&gt;
  </code></pre>
  
  <p><strong>and many other dependencies</strong></p>
  
  <p>My application uses in-memory-derby (embedded profile)/MySQL(remote profile) for transactional data storage and Neo4j graph database to handle hierarchical data storage. My requirement is to run Neo4j in both remote and embedded mode based on the maven profile. By default spring version manager uses older version of Spring-data-neo4j (3.x.x) but the embedded Neo4j support is only available after release 4.0.0. When I build my application with the config shown above I am getting an error as shown below, </p>
  
  <pre><code>// ...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.&lt;init&gt;(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
  </code></pre>
  
  <p>I guess this error is because of the conflicting versions of Spring-data-commons. Is there a way to get around this error?</p>