title: Spring Boot exported jar not working (org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'entityManagerFactory')
body: <p>We have been working on project which works fine when we run it in the (Intellij) ide. But when we export the the spring boot project as a jar file, it no longer works</p>
  
  <pre><code>    21:33:06.495 [main] INFO  demo.TrainsFromApplication - Starting TrainsFromApplication on macbook-pro with PID 1955 (/Users/sauravskumar/IdeaProjects/TrainsFrom/out/artifacts/TrainsFrom_jar/TrainsFrom.jar started by sauravskumar in /Users/sauravskumar/IdeaProjects/TrainsFrom/out/artifacts/TrainsFrom_jar)
  21:33:06.687 [main] INFO  o.s.b.c.e.AnnotationConfigEmbeddedWebApplicationContext - Refreshing org.springframework.boot.context.embedded.AnnotationConfigEmbeddedWebApplicationContext@23282c25: startup date [Sun Aug 23 21:33:06 IST 2015]; root of context hierarchy
  21:33:09.528 [main] INFO  o.s.b.f.s.DefaultListableBeanFactory - Overriding bean definition for bean 'beanNameViewResolver' with a different definition: replacing [Root bean: class [null]; scope=; abstract=false; lazyInit=false; autowireMode=3; dependencyCheck=0; autowireCandidate=true; primary=false; factoryBeanName=org.springframework.boot.autoconfigure.web.ErrorMvcAutoConfiguration$WhitelabelErrorViewConfiguration; factoryMethodName=beanNameViewResolver; initMethodName=null; destroyMethodName=(inferred); defined in class path resource [org/springframework/boot/autoconfigure/web/ErrorMvcAutoConfiguration$WhitelabelErrorViewConfiguration.class]] with [Root bean: class [null]; scope=; abstract=false; lazyInit=false; autowireMode=3; dependencyCheck=0; autowireCandidate=true; primary=false; factoryBeanName=org.springframework.boot.autoconfigure.web.WebMvcAutoConfiguration$WebMvcAutoConfigurationAdapter; factoryMethodName=beanNameViewResolver; initMethodName=null; destroyMethodName=(inferred); defined in class path resource [org/springframework/boot/autoconfigure/web/WebMvcAutoConfiguration$WebMvcAutoConfigurationAdapter.class]]
  21:33:10.660 [main] INFO  o.h.validator.internal.util.Version - HV000001: Hibernate Validator 5.1.3.Final
  21:33:10.941 [main] WARN  demo.TrainsFromApplication - No Spring profile configured, running with default configuration
  21:33:10.941 [main] INFO  o.s.c.s.PostProcessorRegistrationDelegate$BeanPostProcessorChecker - Bean 'trainsFromApplication' of type [class demo.TrainsFromApplication$$EnhancerBySpringCGLIB$$e78db5e1] is not eligible for getting processed by all BeanPostProcessors (for example: not eligible for auto-proxying)
  21:33:10.942 [main] INFO  o.s.d.n.config.Neo4jConfiguration - Initialising PersistenceExceptionTranslationPostProcessor
  21:33:11.143 [main] INFO  o.s.c.s.PostProcessorRegistrationDelegate$BeanPostProcessorChecker - Bean 'org.springframework.transaction.annotation.ProxyTransactionManagementConfiguration' of type [class org.springframework.transaction.annotation.ProxyTransactionManagementConfiguration$$EnhancerBySpringCGLIB$$5c0f18ac] is not eligible for getting processed by all BeanPostProcessors (for example: not eligible for auto-proxying)
  21:33:12.005 [main] INFO  org.eclipse.jetty.util.log - Logging initialized @10510ms
  21:33:12.376 [main] INFO  o.s.b.c.e.j.JettyEmbeddedServletContainerFactory - Server initialized with port: 8080
  21:33:12.380 [main] INFO  org.eclipse.jetty.server.Server - jetty-9.2.11.v20150529
  21:33:12.678 [main] INFO  application - Initializing Spring embedded WebApplicationContext
  21:33:12.678 [main] INFO  o.s.web.context.ContextLoader - Root WebApplicationContext: initialization completed in 6046 ms
  21:33:14.305 [main] INFO  o.s.b.c.e.ServletRegistrationBean - Mapping servlet: 'dispatcherServlet' to [/]
  21:33:14.348 [main] INFO  o.s.b.c.e.FilterRegistrationBean - Mapping filter: 'characterEncodingFilter' to: [/*]
  21:33:14.359 [main] INFO  o.s.b.c.e.FilterRegistrationBean - Mapping filter: 'hiddenHttpMethodFilter' to: [/*]
  21:33:14.360 [main] INFO  o.s.b.c.e.FilterRegistrationBean - Mapping filter: 'simpleCORSFilter' to: [/*]
  21:33:14.361 [main] INFO  o.e.j.server.handler.ContextHandler - Started o.s.b.c.e.j.JettyEmbeddedWebAppContext@5c5d6175{/,null,AVAILABLE}
  21:33:14.361 [main] INFO  org.eclipse.jetty.server.Server - Started @12866ms
  21:33:15.233 [main] INFO  o.s.o.j.LocalContainerEntityManagerFactoryBean - Building JPA container EntityManagerFactory for persistence unit 'default'
  21:33:15.302 [main] INFO  o.h.jpa.internal.util.LogHelper - HHH000204: Processing PersistenceUnitInfo [
      name: default
      ...]
  21:33:15.558 [main] INFO  org.hibernate.Version - HHH000412: Hibernate Core {4.3.10.Final}
  21:33:15.562 [main] INFO  org.hibernate.cfg.Environment - HHH000206: hibernate.properties not found
  21:33:15.566 [main] INFO  org.hibernate.cfg.Environment - HHH000021: Bytecode provider name : javassist
  21:33:15.637 [main] WARN  o.s.b.c.e.AnnotationConfigEmbeddedWebApplicationContext - Exception encountered during context initialization - cancelling refresh attempt
  org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'entityManagerFactory' defined in class path resource [org/springframework/boot/autoconfigure/orm/jpa/HibernateJpaAutoConfiguration.class]: Invocation of init method failed; nested exception is java.lang.NoSuchMethodError: javax.persistence.spi.PersistenceUnitInfo.getValidationMode()Ljavax/persistence/ValidationMode;
      at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.initializeBean(AbstractAutowireCapableBeanFactory.java:1578) ~[spring-beans-4.2.0.RC1.jar:4.2.0.RC1]
      at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:545) ~[spring-beans-4.2.0.RC1.jar:4.2.0.RC1]
      at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:482) ~[spring-beans-4.2.0.RC1.jar:4.2.0.RC1]
      at org.springframework.beans.factory.support.AbstractBeanFactory$1.getObject(AbstractBeanFactory.java:304) ~[spring-beans-4.2.0.RC1.jar:4.2.0.RC1]
      at org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton(DefaultSingletonBeanRegistry.java:230) ~[spring-beans-4.2.0.RC1.jar:4.2.0.RC1]
      at org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:300) ~[spring-beans-4.2.0.RC1.jar:4.2.0.RC1]
      at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:195) ~[spring-beans-4.2.0.RC1.jar:4.2.0.RC1]
      at org.springframework.context.support.AbstractApplicationContext.getBean(AbstractApplicationContext.java:1011) ~[spring-context-4.2.0.RC1.jar:4.2.0.RC1]
      at org.springframework.context.support.AbstractApplicationContext.finishBeanFactoryInitialization(AbstractApplicationContext.java:802) ~[spring-context-4.2.0.RC1.jar:4.2.0.RC1]
      at org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:521) ~[spring-context-4.2.0.RC1.jar:4.2.0.RC1]
      at org.springframework.boot.context.embedded.EmbeddedWebApplicationContext.refresh(EmbeddedWebApplicationContext.java:118) [spring-boot-1.3.0.M1.jar:1.3.0.M1]
      at org.springframework.boot.SpringApplication.refresh(SpringApplication.java:678) [spring-boot-1.3.0.M1.jar:1.3.0.M1]
      at org.springframework.boot.SpringApplication.doRun(SpringApplication.java:339) [spring-boot-1.3.0.M1.jar:1.3.0.M1]
      at org.springframework.boot.SpringApplication.run(SpringApplication.java:274) [spring-boot-1.3.0.M1.jar:1.3.0.M1]
      at demo.TrainsFromApplication.main(TrainsFromApplication.java:119) [TrainsFrom.jar:na]
  Caused by: java.lang.NoSuchMethodError: javax.persistence.spi.PersistenceUnitInfo.getValidationMode()Ljavax/persistence/ValidationMode;
      at org.hibernate.jpa.boot.internal.PersistenceUnitInfoDescriptor.getValidationMode(PersistenceUnitInfoDescriptor.java:99) ~[hibernate-entitymanager-4.3.10.Final.jar:4.3.10.Final]
      at org.hibernate.jpa.boot.internal.EntityManagerFactoryBuilderImpl.mergePropertySources(EntityManagerFactoryBuilderImpl.java:569) ~[hibernate-entitymanager-4.3.10.Final.jar:4.3.10.Final]
      at org.hibernate.jpa.boot.internal.EntityManagerFactoryBuilderImpl.&lt;init&gt;(EntityManagerFactoryBuilderImpl.java:214) ~[hibernate-entitymanager-4.3.10.Final.jar:4.3.10.Final]
      at org.hibernate.jpa.boot.internal.EntityManagerFactoryBuilderImpl.&lt;init&gt;(EntityManagerFactoryBuilderImpl.java:188) ~[hibernate-entitymanager-4.3.10.Final.jar:4.3.10.Final]
      at org.springframework.orm.jpa.vendor.SpringHibernateJpaPersistenceProvider.createContainerEntityManagerFactory(SpringHibernateJpaPersistenceProvider.java:54) ~[spring-orm-4.2.0.RC1.jar:4.2.0.RC1]
      at org.springframework.orm.jpa.LocalContainerEntityManagerFactoryBean.createNativeEntityManagerFactory(LocalContainerEntityManagerFactoryBean.java:343) ~[spring-orm-4.2.0.RC1.jar:4.2.0.RC1]
      at org.springframework.orm.jpa.AbstractEntityManagerFactoryBean.afterPropertiesSet(AbstractEntityManagerFactoryBean.java:318) ~[spring-orm-4.2.0.RC1.jar:4.2.0.RC1]
      at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.invokeInitMethods(AbstractAutowireCapableBeanFactory.java:1637) ~[spring-beans-4.2.0.RC1.jar:4.2.0.RC1]
      at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.initializeBean(AbstractAutowireCapableBeanFactory.java:1574) ~[spring-beans-4.2.0.RC1.jar:4.2.0.RC1]
      ... 14 common frames omitted
  21:33:15.755 [main] INFO  o.e.j.server.handler.ContextHandler - Stopped o.s.b.c.e.j.JettyEmbeddedWebAppContext@5c5d6175{/,null,UNAVAILABLE}
  21:33:15.758 [main] INFO  o.s.b.l.ClasspathLoggingApplicationListener - Application failed to start with classpath: [file:/Users/sauravskumar/IdeaProjects/TrainsFrom/out/artifacts/TrainsFrom_jar/TrainsFrom.jar]
  21:33:15.758 [main] ERROR o.s.boot.SpringApplication - Application startup failed
  org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'entityManagerFactory' defined in class path resource [org/springframework/boot/autoconfigure/orm/jpa/HibernateJpaAutoConfiguration.class]: Invocation of init method failed; nested exception is java.lang.NoSuchMethodError: javax.persistence.spi.PersistenceUnitInfo.getValidationMode()Ljavax/persistence/ValidationMode;
      at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.initializeBean(AbstractAutowireCapableBeanFactory.java:1578) ~[spring-beans-4.2.0.RC1.jar:4.2.0.RC1]
      at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:545) ~[spring-beans-4.2.0.RC1.jar:4.2.0.RC1]
      at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:482) ~[spring-beans-4.2.0.RC1.jar:4.2.0.RC1]
      at org.springframework.beans.factory.support.AbstractBeanFactory$1.getObject(AbstractBeanFactory.java:304) ~[spring-beans-4.2.0.RC1.jar:4.2.0.RC1]
      at org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton(DefaultSingletonBeanRegistry.java:230) ~[spring-beans-4.2.0.RC1.jar:4.2.0.RC1]
      at org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:300) ~[spring-beans-4.2.0.RC1.jar:4.2.0.RC1]
      at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:195) ~[spring-beans-4.2.0.RC1.jar:4.2.0.RC1]
      at org.springframework.context.support.AbstractApplicationContext.getBean(AbstractApplicationContext.java:1011) ~[spring-context-4.2.0.RC1.jar:4.2.0.RC1]
      at org.springframework.context.support.AbstractApplicationContext.finishBeanFactoryInitialization(AbstractApplicationContext.java:802) ~[spring-context-4.2.0.RC1.jar:4.2.0.RC1]
      at org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:521) ~[spring-context-4.2.0.RC1.jar:4.2.0.RC1]
      at org.springframework.boot.context.embedded.EmbeddedWebApplicationContext.refresh(EmbeddedWebApplicationContext.java:118) ~[spring-boot-1.3.0.M1.jar:1.3.0.M1]
      at org.springframework.boot.SpringApplication.refresh(SpringApplication.java:678) ~[spring-boot-1.3.0.M1.jar:1.3.0.M1]
      at org.springframework.boot.SpringApplication.doRun(SpringApplication.java:339) ~[spring-boot-1.3.0.M1.jar:1.3.0.M1]
      at org.springframework.boot.SpringApplication.run(SpringApplication.java:274) ~[spring-boot-1.3.0.M1.jar:1.3.0.M1]
      at demo.TrainsFromApplication.main(TrainsFromApplication.java:119) [TrainsFrom.jar:na]
  Caused by: java.lang.NoSuchMethodError: javax.persistence.spi.PersistenceUnitInfo.getValidationMode()Ljavax/persistence/ValidationMode;
      at org.hibernate.jpa.boot.internal.PersistenceUnitInfoDescriptor.getValidationMode(PersistenceUnitInfoDescriptor.java:99) ~[hibernate-entitymanager-4.3.10.Final.jar:4.3.10.Final]
      at org.hibernate.jpa.boot.internal.EntityManagerFactoryBuilderImpl.mergePropertySources(EntityManagerFactoryBuilderImpl.java:569) ~[hibernate-entitymanager-4.3.10.Final.jar:4.3.10.Final]
      at org.hibernate.jpa.boot.internal.EntityManagerFactoryBuilderImpl.&lt;init&gt;(EntityManagerFactoryBuilderImpl.java:214) ~[hibernate-entitymanager-4.3.10.Final.jar:4.3.10.Final]
      at org.hibernate.jpa.boot.internal.EntityManagerFactoryBuilderImpl.&lt;init&gt;(EntityManagerFactoryBuilderImpl.java:188) ~[hibernate-entitymanager-4.3.10.Final.jar:4.3.10.Final]
      at org.springframework.orm.jpa.vendor.SpringHibernateJpaPersistenceProvider.createContainerEntityManagerFactory(SpringHibernateJpaPersistenceProvider.java:54) ~[spring-orm-4.2.0.RC1.jar:4.2.0.RC1]
      at org.springframework.orm.jpa.LocalContainerEntityManagerFactoryBean.createNativeEntityManagerFactory(LocalContainerEntityManagerFactoryBean.java:343) ~[spring-orm-4.2.0.RC1.jar:4.2.0.RC1]
      at org.springframework.orm.jpa.AbstractEntityManagerFactoryBean.afterPropertiesSet(AbstractEntityManagerFactoryBean.java:318) ~[spring-orm-4.2.0.RC1.jar:4.2.0.RC1]
      at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.invokeInitMethods(AbstractAutowireCapableBeanFactory.java:1637) ~[spring-beans-4.2.0.RC1.jar:4.2.0.RC1]
      at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.initializeBean(AbstractAutowireCapableBeanFactory.java:1574) ~[spring-beans-4.2.0.RC1.jar:4.2.0.RC1]
      ... 14 common frames omitted
  Exception in thread "main" org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'entityManagerFactory' defined in class path resource [org/springframework/boot/autoconfigure/orm/jpa/HibernateJpaAutoConfiguration.class]: Invocation of init method failed; nested exception is java.lang.NoSuchMethodError: javax.persistence.spi.PersistenceUnitInfo.getValidationMode()Ljavax/persistence/ValidationMode;
      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:304)
      at org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton(DefaultSingletonBeanRegistry.java:230)
      at org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:300)
      at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:195)
      at org.springframework.context.support.AbstractApplicationContext.getBean(AbstractApplicationContext.java:1011)
      at org.springframework.context.support.AbstractApplicationContext.finishBeanFactoryInitialization(AbstractApplicationContext.java:802)
      at org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:521)
      at org.springframework.boot.context.embedded.EmbeddedWebApplicationContext.refresh(EmbeddedWebApplicationContext.java:118)
      at org.springframework.boot.SpringApplication.refresh(SpringApplication.java:678)
      at org.springframework.boot.SpringApplication.doRun(SpringApplication.java:339)
      at org.springframework.boot.SpringApplication.run(SpringApplication.java:274)
      at demo.TrainsFromApplication.main(TrainsFromApplication.java:119)
  Caused by: java.lang.NoSuchMethodError: javax.persistence.spi.PersistenceUnitInfo.getValidationMode()Ljavax/persistence/ValidationMode;
      at org.hibernate.jpa.boot.internal.PersistenceUnitInfoDescriptor.getValidationMode(PersistenceUnitInfoDescriptor.java:99)
      at org.hibernate.jpa.boot.internal.EntityManagerFactoryBuilderImpl.mergePropertySources(EntityManagerFactoryBuilderImpl.java:569)
      at org.hibernate.jpa.boot.internal.EntityManagerFactoryBuilderImpl.&lt;init&gt;(EntityManagerFactoryBuilderImpl.java:214)
      at org.hibernate.jpa.boot.internal.EntityManagerFactoryBuilderImpl.&lt;init&gt;(EntityManagerFactoryBuilderImpl.java:188)
      at org.springframework.orm.jpa.vendor.SpringHibernateJpaPersistenceProvider.createContainerEntityManagerFactory(SpringHibernateJpaPersistenceProvider.java:54)
      at org.springframework.orm.jpa.LocalContainerEntityManagerFactoryBean.createNativeEntityManagerFactory(LocalContainerEntityManagerFactoryBean.java:343)
      at org.springframework.orm.jpa.AbstractEntityManagerFactoryBean.afterPropertiesSet(AbstractEntityManagerFactoryBean.java:318)
      at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.invokeInitMethods(AbstractAutowireCapableBeanFactory.java:1637)
      at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.initializeBean(AbstractAutowireCapableBeanFactory.java:1574)
      ... 14 more
  </code></pre>
  
  <p>The pom.xml file is:-</p>
  
  <pre><code>&lt;?xml version="1.0" encoding="UTF-8"?&gt;
  &lt;project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
      xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"&gt;
      &lt;modelVersion&gt;4.0.0&lt;/modelVersion&gt;
  
  &lt;groupId&gt;org.test&lt;/groupId&gt;
  &lt;artifactId&gt;demo&lt;/artifactId&gt;
  &lt;version&gt;0.0.1-SNAPSHOT&lt;/version&gt;
  &lt;packaging&gt;jar&lt;/packaging&gt;
  
  &lt;name&gt;trains_from&lt;/name&gt;
  &lt;description&gt;Demo project for Spring Boot&lt;/description&gt;
  
  &lt;parent&gt;
      &lt;groupId&gt;org.springframework.boot&lt;/groupId&gt;
      &lt;artifactId&gt;spring-boot-starter-parent&lt;/artifactId&gt;
      &lt;version&gt;1.3.0.M1&lt;/version&gt;
      &lt;!--&lt;version&gt;1.3.0.M3&lt;/version&gt;--&gt;
      &lt;!--&lt;relativePath/&gt; &amp;lt;!&amp;ndash; lookup parent from repository &amp;ndash;&amp;gt;--&gt;
  &lt;/parent&gt;
  
  &lt;properties&gt;
      &lt;neo4j.version&gt;2.2.4&lt;/neo4j.version&gt;
      &lt;project.build.sourceEncoding&gt;UTF-8&lt;/project.build.sourceEncoding&gt;
      &lt;java.version&gt;1.8&lt;/java.version&gt;
      &lt;!--&lt;springdatacommons.version&gt;1.11.0.RC1&lt;/springdatacommons.version&gt;--&gt;
      &lt;springdatacommons.version&gt;1.11.0.BUILD-SNAPSHOT&lt;/springdatacommons.version&gt;
  &lt;/properties&gt;
  
  &lt;dependencies&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;
  
      &lt;!--&lt;dependency&gt;--&gt;
          &lt;!--&lt;groupId&gt;redis.clients&lt;/groupId&gt;--&gt;
          &lt;!--&lt;artifactId&gt;jedis&lt;/artifactId&gt;--&gt;
          &lt;!--&lt;version&gt;2.7.2&lt;/version&gt;--&gt;
          &lt;!--&lt;type&gt;jar&lt;/type&gt;--&gt;
          &lt;!--&lt;scope&gt;compile&lt;/scope&gt;--&gt;
      &lt;!--&lt;/dependency&gt;--&gt;
      &lt;!--&lt;dependency&gt;--&gt;
          &lt;!--&lt;groupId&gt;org.springframework.boot&lt;/groupId&gt;--&gt;
          &lt;!--&lt;artifactId&gt;spring-boot-starter-jdbc&lt;/artifactId&gt;--&gt;
      &lt;!--&lt;/dependency&gt;--&gt;
      &lt;!--&lt;dependency&gt;--&gt;
          &lt;!--&lt;groupId&gt;org.springframework.boot&lt;/groupId&gt;--&gt;
          &lt;!--&lt;artifactId&gt;spring-boot-starter-redis&lt;/artifactId&gt;--&gt;
      &lt;!--&lt;/dependency&gt;--&gt;
      &lt;dependency&gt;
          &lt;groupId&gt;org.springframework.boot&lt;/groupId&gt;
          &lt;artifactId&gt;spring-boot-starter-web&lt;/artifactId&gt;
      &lt;/dependency&gt;
      &lt;!-- spring-data-neo4j --&gt;
      &lt;dependency&gt;
          &lt;groupId&gt;org.neo4j&lt;/groupId&gt;
          &lt;artifactId&gt;neo4j-ogm&lt;/artifactId&gt;
          &lt;version&gt;1.1.1&lt;/version&gt;
      &lt;/dependency&gt;
      &lt;dependency&gt;
          &lt;groupId&gt;org.springframework.data&lt;/groupId&gt;
          &lt;artifactId&gt;spring-data-commons&lt;/artifactId&gt;
          &lt;version&gt;${springdatacommons.version}&lt;/version&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.0.0.RC1&lt;/version&gt;
      &lt;/dependency&gt;
      &lt;!--&lt;dependency&gt;--&gt;
          &lt;!--&lt;groupId&gt;org.neo4j.app&lt;/groupId&gt;--&gt;
          &lt;!--&lt;artifactId&gt;neo4j-server&lt;/artifactId&gt;--&gt;
          &lt;!--&lt;version&gt;${neo4j.version}&lt;/version&gt;--&gt;
      &lt;!--&lt;/dependency&gt;--&gt;
      &lt;dependency&gt;
          &lt;groupId&gt;com.voodoodyne.jackson.jsog&lt;/groupId&gt;
          &lt;artifactId&gt;jackson-jsog&lt;/artifactId&gt;
          &lt;version&gt;1.1&lt;/version&gt;
          &lt;scope&gt;compile&lt;/scope&gt;
      &lt;/dependency&gt;
      &lt;dependency&gt;
          &lt;groupId&gt;mysql&lt;/groupId&gt;
          &lt;artifactId&gt;mysql-connector-java&lt;/artifactId&gt;
          &lt;scope&gt;runtime&lt;/scope&gt;
      &lt;/dependency&gt;
  
      &lt;dependency&gt;
          &lt;groupId&gt;org.springframework.boot&lt;/groupId&gt;
          &lt;artifactId&gt;spring-boot-starter-test&lt;/artifactId&gt;
          &lt;scope&gt;test&lt;/scope&gt;
      &lt;/dependency&gt;
      &lt;!--&lt;dependency&gt;--&gt;
          &lt;!--&lt;groupId&gt;org.springframework.data&lt;/groupId&gt;--&gt;
          &lt;!--&lt;artifactId&gt;spring-data-neo4j&lt;/artifactId&gt;--&gt;
          &lt;!--&lt;version&gt;4.0.0.BUILD-SNAPSHOT&lt;/version&gt;--&gt;
          &lt;!--&lt;type&gt;test-jar&lt;/type&gt;--&gt;
      &lt;!--&lt;/dependency&gt;--&gt;
  
      &lt;!--REST--&gt;
      &lt;!--&lt;dependency&gt;--&gt;
          &lt;!--&lt;groupId&gt;org.json&lt;/groupId&gt;--&gt;
          &lt;!--&lt;artifactId&gt;json&lt;/artifactId&gt;--&gt;
          &lt;!--&lt;version&gt;20141113&lt;/version&gt;--&gt;
      &lt;!--&lt;/dependency&gt;--&gt;
      &lt;!--&lt;dependency&gt;--&gt;
          &lt;!--&lt;groupId&gt;com.googlecode.json-simple&lt;/groupId&gt;--&gt;
          &lt;!--&lt;artifactId&gt;json-simple&lt;/artifactId&gt;--&gt;
          &lt;!--&lt;version&gt;1.1.1&lt;/version&gt;--&gt;
      &lt;!--&lt;/dependency&gt;--&gt;
      &lt;!--&lt;dependency&gt;--&gt;
          &lt;!--&lt;groupId&gt;com.squareup.okhttp&lt;/groupId&gt;--&gt;
          &lt;!--&lt;artifactId&gt;okhttp&lt;/artifactId&gt;--&gt;
          &lt;!--&lt;version&gt;2.4.0&lt;/version&gt;--&gt;
      &lt;!--&lt;/dependency&gt;--&gt;
      &lt;dependency&gt;
          &lt;groupId&gt;com.mashape.unirest&lt;/groupId&gt;
          &lt;artifactId&gt;unirest-java&lt;/artifactId&gt;
          &lt;version&gt;1.4.6&lt;/version&gt;
      &lt;/dependency&gt;
      &lt;dependency&gt;
          &lt;groupId&gt;org.apache.httpcomponents&lt;/groupId&gt;
          &lt;artifactId&gt;httpclient&lt;/artifactId&gt;
          &lt;version&gt;4.3.6&lt;/version&gt;
      &lt;/dependency&gt;
      &lt;dependency&gt;
          &lt;groupId&gt;org.apache.httpcomponents&lt;/groupId&gt;
          &lt;artifactId&gt;httpasyncclient&lt;/artifactId&gt;
          &lt;version&gt;4.0.2&lt;/version&gt;
      &lt;/dependency&gt;
      &lt;dependency&gt;
          &lt;groupId&gt;org.apache.httpcomponents&lt;/groupId&gt;
          &lt;artifactId&gt;httpmime&lt;/artifactId&gt;
          &lt;version&gt;4.3.6&lt;/version&gt;
      &lt;/dependency&gt;
      &lt;dependency&gt;
          &lt;groupId&gt;org.json&lt;/groupId&gt;
          &lt;artifactId&gt;json&lt;/artifactId&gt;
          &lt;version&gt;20141113&lt;/version&gt;
      &lt;/dependency&gt;
  
      &lt;dependency&gt;
          &lt;groupId&gt;junit&lt;/groupId&gt;
          &lt;artifactId&gt;junit&lt;/artifactId&gt;
          &lt;version&gt;4.11&lt;/version&gt;
          &lt;scope&gt;test&lt;/scope&gt;
      &lt;/dependency&gt;
      &lt;dependency&gt;
          &lt;groupId&gt;commons-io&lt;/groupId&gt;
          &lt;artifactId&gt;commons-io&lt;/artifactId&gt;
          &lt;version&gt;2.4&lt;/version&gt;
          &lt;scope&gt;test&lt;/scope&gt;
      &lt;/dependency&gt;
  
  
      &lt;dependency&gt;
          &lt;groupId&gt;org.neo4j&lt;/groupId&gt;
          &lt;artifactId&gt;neo4j-kernel&lt;/artifactId&gt;
          &lt;version&gt;${neo4j.version}&lt;/version&gt;
          &lt;type&gt;test-jar&lt;/type&gt;
      &lt;/dependency&gt;
  
      &lt;dependency&gt;
          &lt;groupId&gt;org.neo4j.app&lt;/groupId&gt;
          &lt;artifactId&gt;neo4j-server&lt;/artifactId&gt;
          &lt;version&gt;${neo4j.version}&lt;/version&gt;
          &lt;type&gt;test-jar&lt;/type&gt;
      &lt;/dependency&gt;
      &lt;dependency&gt;
          &lt;groupId&gt;org.neo4j&lt;/groupId&gt;
          &lt;artifactId&gt;neo4j-io&lt;/artifactId&gt;
          &lt;version&gt;${neo4j.version}&lt;/version&gt;
          &lt;type&gt;test-jar&lt;/type&gt;
      &lt;/dependency&gt;
  
  &lt;/dependencies&gt;
  
  &lt;build&gt;
      &lt;plugins&gt;
          &lt;plugin&gt;
              &lt;groupId&gt;org.springframework.boot&lt;/groupId&gt;
              &lt;artifactId&gt;spring-boot-maven-plugin&lt;/artifactId&gt;
              &lt;!--&lt;configuration&gt;--&gt;
                  &lt;!--&lt;mainClass&gt;demo.TrainsFromApplication&lt;/mainClass&gt;--&gt;
              &lt;!--&lt;/configuration&gt;--&gt;
          &lt;/plugin&gt;
      &lt;/plugins&gt;
  &lt;/build&gt;
  &lt;repositories&gt;
  
      &lt;repository&gt;
          &lt;id&gt;spring-libs-snapshot&lt;/id&gt;
          &lt;name&gt;Spring&lt;/name&gt;
          &lt;url&gt;http://repo.spring.io/libs-snapshot&lt;/url&gt;
      &lt;/repository&gt;
  
      &lt;repository&gt;
          &lt;id&gt;spring-snapshots&lt;/id&gt;
          &lt;url&gt;http://repo.spring.io/snapshot&lt;/url&gt;
          &lt;snapshots&gt;&lt;enabled&gt;true&lt;/enabled&gt;&lt;/snapshots&gt;
      &lt;/repository&gt;
  
      &lt;repository&gt;
          &lt;id&gt;spring-milestones&lt;/id&gt;
          &lt;url&gt;http://repo.spring.io/milestone&lt;/url&gt;
      &lt;/repository&gt;
  
      &lt;repository&gt;
          &lt;id&gt;neo4j&lt;/id&gt;
          &lt;url&gt;http://m2.neo4j.org/content/repositories/releases&lt;/url&gt;
          &lt;snapshots&gt;
              &lt;enabled&gt;true&lt;/enabled&gt;
          &lt;/snapshots&gt;
      &lt;/repository&gt;
  
  &lt;/repositories&gt;
  
  &lt;pluginRepositories&gt;
  
      &lt;pluginRepository&gt;
          &lt;id&gt;spring-snapshots&lt;/id&gt;
          &lt;url&gt;http://repo.spring.io/snapshot&lt;/url&gt;
      &lt;/pluginRepository&gt;
  
      &lt;pluginRepository&gt;
          &lt;id&gt;spring-milestones&lt;/id&gt;
          &lt;url&gt;http://repo.spring.io/milestone&lt;/url&gt;
      &lt;/pluginRepository&gt;
  
  &lt;/pluginRepositories&gt;
  
  &lt;!--&lt;repositories&gt;--&gt;
      &lt;!--&lt;repository&gt;--&gt;
          &lt;!--&lt;id&gt;spring-snapshots&lt;/id&gt;--&gt;
          &lt;!--&lt;name&gt;Spring Snapshots&lt;/name&gt;--&gt;
          &lt;!--&lt;url&gt;https://repo.spring.io/snapshot&lt;/url&gt;--&gt;
          &lt;!--&lt;snapshots&gt;--&gt;
              &lt;!--&lt;enabled&gt;true&lt;/enabled&gt;--&gt;
          &lt;!--&lt;/snapshots&gt;--&gt;
      &lt;!--&lt;/repository&gt;--&gt;
      &lt;!--&lt;repository&gt;--&gt;
          &lt;!--&lt;id&gt;spring-milestones&lt;/id&gt;--&gt;
          &lt;!--&lt;name&gt;Spring Milestones&lt;/name&gt;--&gt;
          &lt;!--&lt;url&gt;https://repo.spring.io/milestone&lt;/url&gt;--&gt;
          &lt;!--&lt;snapshots&gt;--&gt;
              &lt;!--&lt;enabled&gt;false&lt;/enabled&gt;--&gt;
          &lt;!--&lt;/snapshots&gt;--&gt;
      &lt;!--&lt;/repository&gt;--&gt;
  &lt;!--&lt;/repositories&gt;--&gt;
  &lt;!--&lt;pluginRepositories&gt;--&gt;
      &lt;!--&lt;pluginRepository&gt;--&gt;
          &lt;!--&lt;id&gt;spring-snapshots&lt;/id&gt;--&gt;
          &lt;!--&lt;name&gt;Spring Snapshots&lt;/name&gt;--&gt;
          &lt;!--&lt;url&gt;https://repo.spring.io/snapshot&lt;/url&gt;--&gt;
          &lt;!--&lt;snapshots&gt;--&gt;
              &lt;!--&lt;enabled&gt;true&lt;/enabled&gt;--&gt;
          &lt;!--&lt;/snapshots&gt;--&gt;
      &lt;!--&lt;/pluginRepository&gt;--&gt;
      &lt;!--&lt;pluginRepository&gt;--&gt;
          &lt;!--&lt;id&gt;spring-milestones&lt;/id&gt;--&gt;
          &lt;!--&lt;name&gt;Spring Milestones&lt;/name&gt;--&gt;
          &lt;!--&lt;url&gt;https://repo.spring.io/milestone&lt;/url&gt;--&gt;
          &lt;!--&lt;snapshots&gt;--&gt;
              &lt;!--&lt;enabled&gt;false&lt;/enabled&gt;--&gt;
          &lt;!--&lt;/snapshots&gt;--&gt;
      &lt;!--&lt;/pluginRepository&gt;--&gt;
  &lt;!--&lt;/pluginRepositories&gt;--&gt;
  </code></pre>
  
  <p></p>
  
  <pre><code># application.properties file is
  
  
  spring.datasource.url = jdbc:mysql://localhost:3306/trains_from_test
  
  
  spring.datasource.username = root
  spring.datasource.password =
  
  
  spring.jpa.show-sql = true
  
  
  spring.jpa.hibernate.ddl-auto = none
  
  
  spring.jpa.hibernate.naming-strategy = org.hibernate.cfg.ImprovedNamingStrategy
  
  
  spring.jpa.properties.hibernate.dialect = org.hibernate.dialect.MySQL5Dialect
  </code></pre>
  
  <p>when we replace the </p>
  
  <pre><code>&lt;parent&gt;
          &lt;groupId&gt;org.springframework.boot&lt;/groupId&gt;
          &lt;artifactId&gt;spring-boot-starter-parent&lt;/artifactId&gt;
          &lt;version&gt;1.3.0.M1&lt;/version&gt; 
  &lt;/parent&gt;
  </code></pre>
  
  <p>in pom.xml with </p>
  
  <pre><code>&lt;parent&gt;
          &lt;groupId&gt;org.springframework.boot&lt;/groupId&gt;
          &lt;artifactId&gt;spring-boot-starter-parent&lt;/artifactId&gt;
          &lt;version&gt;1.3.0.M2&lt;/version&gt; 
  &lt;/parent&gt;
  </code></pre>
  
  <p>The error changes to: -   </p>
  
  <pre><code>  macbook-pro:TrainsFrom_jar sauravskumar$ java -jar TrainsFrom.jar
  Exception in thread "main" java.lang.NoClassDefFoundError: org/springframework/dao/support/PersistenceExceptionTranslator
      at java.lang.Class.getDeclaredMethods0(Native Method)
      at java.lang.Class.privateGetDeclaredMethods(Class.java:2693)
      at java.lang.Class.privateGetMethodRecursive(Class.java:3040)
      at java.lang.Class.getMethod0(Class.java:3010)
      at java.lang.Class.getMethod(Class.java:1776)
      at sun.launcher.LauncherHelper.validateMainClass(LauncherHelper.java:544)
      at sun.launcher.LauncherHelper.checkAndLoadMain(LauncherHelper.java:526)
  Caused by: java.lang.ClassNotFoundException: org.springframework.dao.support.PersistenceExceptionTranslator
      at java.net.URLClassLoader$1.run(URLClassLoader.java:372)
      at java.net.URLClassLoader$1.run(URLClassLoader.java:361)
      at java.security.AccessController.doPrivileged(Native Method)
      at java.net.URLClassLoader.findClass(URLClassLoader.java:360)
      at java.lang.ClassLoader.loadClass(ClassLoader.java:424)
      at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:308)
      at java.lang.ClassLoader.loadClass(ClassLoader.java:357)
      ... 7 more
  </code></pre>
  
  <p>Disclaimer: We have also tried</p>
  
  <pre><code>  &lt;properties&gt;
              &lt;neo4j.version&gt;2.2.4&lt;/neo4j.version&gt;
              &lt;project.build.sourceEncoding&gt;UTF-8&lt;/project.build.sourceEncoding&gt;
              &lt;java.version&gt;1.8&lt;/java.version&gt;
              &lt;springdatacommons.version&gt;1.11.0.RC1&lt;/springdatacommons.version&gt;
              &lt;!--&lt;springdatacommons.version&gt;1.11.0.BUILD-SNAPSHOT&lt;/springdatacommons.version&gt;--&gt;
          &lt;/properties&gt;
  </code></pre>
  
  <p>But the output error is the same as the second error. Thank You in advance!</p>