ClassDefFoundError: org/hibernate/HibernateException in SpringBoot app - spring

I have an SpringBoot app., a basic web skeleton app using embedded Tomcat + Thymeleaf template engine.
with this pom.xml with this dependencies
<dependencies>
<!-- Spring Boot dependencies -->
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-thymeleaf</artifactId>
</dependency>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-web</artifactId>
</dependency>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-security</artifactId>
</dependency>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-data-jpa</artifactId>
</dependency>
<!-- Spring data -->
<dependency>
<groupId>com.h2database</groupId>
<artifactId>h2</artifactId>
</dependency>
<!-- Test dependencies -->
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-test</artifactId>
<scope>test</scope>
</dependency>
<!-- Spring Security -->
<dependency>
<groupId>org.thymeleaf.extras</groupId>
<artifactId>thymeleaf-extras-springsecurity4</artifactId>
</dependency>
<!-- Email dependencies -->
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-mail</artifactId>
</dependency>
<!-- Logging dependencies -->
<dependency>
<groupId>ch.qos.logback</groupId>
<artifactId>logback-classic</artifactId>
</dependency>
<!-- Webjars for JQuery and Bootstrap -->
<dependency>
<groupId>org.webjars</groupId>
<artifactId>bootstrap</artifactId>
<version>3.3.7-1</version>
</dependency>
<dependency>
<groupId>org.webjars</groupId>
<artifactId>jquery</artifactId>
<version>3.2.0</version>
</dependency>
</dependencies>
This application properties file:
# Spring Data JPA properties
spring.datasource.url=jdbc:h2:mem:testdb;MODE=MySQL;DB_CLOSE_ON_EXIT=FALSE
spring.datasource.username=sa
spring.datasource.password=
spring.jpa.show-sql=true
spring.jpa.properties.hibernate.format_sql=true
hibernate.dialect=org.hibernate.dialect.H2Dialect
but when I start the app. I got this error:
. ____ _ __ _ _
/\\ / ___'_ __ _ _(_)_ __ __ _ \ \ \ \
( ( )\___ | '_ | '_| | '_ \/ _` | \ \ \ \
\\/ ___)| |_)| | | | | || (_| | ) ) ) )
' |____| .__|_| |_|_| |_\__, | / / / /
=========|_|==============|___/=/_/_/_/
:: Spring Boot :: (v1.5.3.RELEASE)
15413 [main] INFO c.d.DevopsbuddyApplication - Starting DevopsbuddyApplication on MacBook-Pro-de-calzada.local with PID 80844 (/Users/nunito/Development/J2EE/workspace-sts-3.8.4.RELEASE/devopsbuddy/target/classes started by nunito in /Users/nunito/Development/J2EE/workspace-sts-3.8.4.RELEASE/devopsbuddy)
15416 [main] DEBUG c.d.DevopsbuddyApplication - Running with Spring Boot v1.5.3.RELEASE, Spring v4.3.8.RELEASE
17325 [main] WARN o.s.b.c.e.AnnotationConfigEmbeddedWebApplicationContext - Exception encountered during context initialization - cancelling refresh attempt: org.springframework.beans.factory.UnsatisfiedDependencyException: Error creating bean with name 'entityManagerFactory' defined in class path resource [org/springframework/boot/autoconfigure/orm/jpa/HibernateJpaAutoConfiguration.class]: Unsatisfied dependency expressed through method 'entityManagerFactory' parameter 0; nested exception is org.springframework.beans.factory.UnsatisfiedDependencyException: Error creating bean with name 'entityManagerFactoryBuilder' defined in class path resource [org/springframework/boot/autoconfigure/orm/jpa/HibernateJpaAutoConfiguration.class]: Unsatisfied dependency expressed through method 'entityManagerFactoryBuilder' parameter 0; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'jpaVendorAdapter' defined in class path resource [org/springframework/boot/autoconfigure/orm/jpa/HibernateJpaAutoConfiguration.class]: Bean instantiation via factory method failed; nested exception is org.springframework.beans.BeanInstantiationException: Failed to instantiate [org.springframework.orm.jpa.JpaVendorAdapter]: Factory method 'jpaVendorAdapter' threw exception; nested exception is java.lang.NoClassDefFoundError: org/hibernate/HibernateException
17341 [main] WARN o.s.boot.SpringApplication - Error handling failed (Error creating bean with name 'delegatingApplicationListener' defined in class path resource [org/springframework/security/config/annotation/web/configuration/WebSecurityConfiguration.class]: Initialization of bean failed; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'org.springframework.transaction.annotation.ProxyTransactionManagementConfiguration': Initialization of bean failed; nested exception is org.springframework.beans.factory.NoSuchBeanDefinitionException: No bean named 'org.springframework.context.annotation.ConfigurationClassPostProcessor.importRegistry' available)
17347 [main] ERROR o.s.boot.SpringApplication - Application startup failed
org.springframework.beans.factory.UnsatisfiedDependencyException: Error creating bean with name 'entityManagerFactory' defined in class path resource [org/springframework/boot/autoconfigure/orm/jpa/HibernateJpaAutoConfiguration.class]: Unsatisfied dependency expressed through method 'entityManagerFactory' parameter 0; nested exception is org.springframework.beans.factory.UnsatisfiedDependencyException: Error creating bean with name 'entityManagerFactoryBuilder' defined in class path resource [org/springframework/boot/autoconfigure/orm/jpa/HibernateJpaAutoConfiguration.class]: Unsatisfied dependency expressed through method 'entityManagerFactoryBuilder' parameter 0; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'jpaVendorAdapter' defined in class path resource [org/springframework/boot/autoconfigure/orm/jpa/HibernateJpaAutoConfiguration.class]: Bean instantiation via factory method failed; nested exception is org.springframework.beans.BeanInstantiationException: Failed to instantiate [org.springframework.orm.jpa.JpaVendorAdapter]: Factory method 'jpaVendorAdapter' threw exception; nested exception is java.lang.NoClassDefFoundError: org/hibernate/HibernateException
at org.springframework.beans.factory.support.ConstructorResolver.createArgumentArray(ConstructorResolver.java:749)
at org.springframework.beans.factory.support.ConstructorResolver.instantiateUsingFactoryMethod(ConstructorResolver.java:467)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.instantiateUsingFactoryMethod(AbstractAutowireCapableBeanFactory.java:1173)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBeanInstance(AbstractAutowireCapableBeanFactory.java:1067)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:513)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:483)
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.context.support.AbstractApplicationContext.getBean(AbstractApplicationContext.java:1081)
at org.springframework.context.support.AbstractApplicationContext.finishBeanFactoryInitialization(AbstractApplicationContext.java:856)
at org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:542)
at org.springframework.boot.context.embedded.EmbeddedWebApplicationContext.refresh(EmbeddedWebApplicationContext.java:122)
at org.springframework.boot.SpringApplication.refresh(SpringApplication.java:737)
at org.springframework.boot.SpringApplication.refreshContext(SpringApplication.java:370)
at org.springframework.boot.SpringApplication.run(SpringApplication.java:314)
at org.springframework.boot.SpringApplication.run(SpringApplication.java:1162)
at org.springframework.boot.SpringApplication.run(SpringApplication.java:1151)
at com.devopsbuddy.DevopsbuddyApplication.main(DevopsbuddyApplication.java:10)
Caused by: org.springframework.beans.factory.UnsatisfiedDependencyException: Error creating bean with name 'entityManagerFactoryBuilder' defined in class path resource [org/springframework/boot/autoconfigure/orm/jpa/HibernateJpaAutoConfiguration.class]: Unsatisfied dependency expressed through method 'entityManagerFactoryBuilder' parameter 0; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'jpaVendorAdapter' defined in class path resource [org/springframework/boot/autoconfigure/orm/jpa/HibernateJpaAutoConfiguration.class]: Bean instantiation via factory method failed; nested exception is org.springframework.beans.BeanInstantiationException: Failed to instantiate [org.springframework.orm.jpa.JpaVendorAdapter]: Factory method 'jpaVendorAdapter' threw exception; nested exception is java.lang.NoClassDefFoundError: org/hibernate/HibernateException
at org.springframework.beans.factory.support.ConstructorResolver.createArgumentArray(ConstructorResolver.java:749)
at org.springframework.beans.factory.support.ConstructorResolver.instantiateUsingFactoryMethod(ConstructorResolver.java:467)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.instantiateUsingFactoryMethod(AbstractAutowireCapableBeanFactory.java:1173)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBeanInstance(AbstractAutowireCapableBeanFactory.java:1067)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:513)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:483)
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:202)
at org.springframework.beans.factory.config.DependencyDescriptor.resolveCandidate(DependencyDescriptor.java:208)
at org.springframework.beans.factory.support.DefaultListableBeanFactory.doResolveDependency(DefaultListableBeanFactory.java:1138)
at org.springframework.beans.factory.support.DefaultListableBeanFactory.resolveDependency(DefaultListableBeanFactory.java:1066)
at org.springframework.beans.factory.support.ConstructorResolver.resolveAutowiredArgument(ConstructorResolver.java:835)
at org.springframework.beans.factory.support.ConstructorResolver.createArgumentArray(ConstructorResolver.java:741)
... 19 common frames omitted
Caused by: org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'jpaVendorAdapter' defined in class path resource [org/springframework/boot/autoconfigure/orm/jpa/HibernateJpaAutoConfiguration.class]: Bean instantiation via factory method failed; nested exception is org.springframework.beans.BeanInstantiationException: Failed to instantiate [org.springframework.orm.jpa.JpaVendorAdapter]: Factory method 'jpaVendorAdapter' threw exception; nested exception is java.lang.NoClassDefFoundError: org/hibernate/HibernateException
at org.springframework.beans.factory.support.ConstructorResolver.instantiateUsingFactoryMethod(ConstructorResolver.java:599)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.instantiateUsingFactoryMethod(AbstractAutowireCapableBeanFactory.java:1173)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBeanInstance(AbstractAutowireCapableBeanFactory.java:1067)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:513)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:483)
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:202)
at org.springframework.beans.factory.config.DependencyDescriptor.resolveCandidate(DependencyDescriptor.java:208)
at org.springframework.beans.factory.support.DefaultListableBeanFactory.doResolveDependency(DefaultListableBeanFactory.java:1138)
at org.springframework.beans.factory.support.DefaultListableBeanFactory.resolveDependency(DefaultListableBeanFactory.java:1066)
at org.springframework.beans.factory.support.ConstructorResolver.resolveAutowiredArgument(ConstructorResolver.java:835)
at org.springframework.beans.factory.support.ConstructorResolver.createArgumentArray(ConstructorResolver.java:741)
... 33 common frames omitted
Caused by: org.springframework.beans.BeanInstantiationException: Failed to instantiate [org.springframework.orm.jpa.JpaVendorAdapter]: Factory method 'jpaVendorAdapter' threw exception; nested exception is java.lang.NoClassDefFoundError: org/hibernate/HibernateException
at org.springframework.beans.factory.support.SimpleInstantiationStrategy.instantiate(SimpleInstantiationStrategy.java:189)
at org.springframework.beans.factory.support.ConstructorResolver.instantiateUsingFactoryMethod(ConstructorResolver.java:588)
... 46 common frames omitted
Caused by: java.lang.NoClassDefFoundError: org/hibernate/HibernateException
at org.springframework.orm.jpa.vendor.HibernateJpaVendorAdapter.<init>(HibernateJpaVendorAdapter.java:64)
at org.springframework.boot.autoconfigure.orm.jpa.HibernateJpaAutoConfiguration.createJpaVendorAdapter(HibernateJpaAutoConfiguration.java:98)
at org.springframework.boot.autoconfigure.orm.jpa.JpaBaseConfiguration.jpaVendorAdapter(JpaBaseConfiguration.java:103)
at org.springframework.boot.autoconfigure.orm.jpa.HibernateJpaAutoConfiguration$$EnhancerBySpringCGLIB$$22397ccc.CGLIB$jpaVendorAdapter$6(<generated>)
at org.springframework.boot.autoconfigure.orm.jpa.HibernateJpaAutoConfiguration$$EnhancerBySpringCGLIB$$22397ccc$$FastClassBySpringCGLIB$$fbd62950.invoke(<generated>)
at org.springframework.cglib.proxy.MethodProxy.invokeSuper(MethodProxy.java:228)
at org.springframework.context.annotation.ConfigurationClassEnhancer$BeanMethodInterceptor.intercept(ConfigurationClassEnhancer.java:358)
at org.springframework.boot.autoconfigure.orm.jpa.HibernateJpaAutoConfiguration$$EnhancerBySpringCGLIB$$22397ccc.jpaVendorAdapter(<generated>)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:498)
at org.springframework.beans.factory.support.SimpleInstantiationStrategy.instantiate(SimpleInstantiationStrategy.java:162)
... 47 common frames omitted
Caused by: java.lang.ClassNotFoundException: org.hibernate.HibernateException
at java.net.URLClassLoader.findClass(URLClassLoader.java:381)
at java.lang.ClassLoader.loadClass(ClassLoader.java:424)
at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:331)
at java.lang.ClassLoader.loadClass(ClassLoader.java:357)
... 60 common frames omitted
I also tried mvn clean install -U
the results of mvn dependency:tree
[INFO] Scanning for projects...
[INFO]
[INFO] ------------------------------------------------------------------------
[INFO] Building devopsbuddy 0.0.1-SNAPSHOT
[INFO] ------------------------------------------------------------------------
[WARNING] The POM for com.h2database:h2:jar:1.4.194 is missing, no dependency information available
[INFO]
[INFO] --- maven-dependency-plugin:2.10:tree (default-cli) # devopsbuddy ---
[INFO] com.devopsbuddy:devopsbuddy:jar:0.0.1-SNAPSHOT
[INFO] +- org.springframework.boot:spring-boot-starter-thymeleaf:jar:1.5.3.RELEASE:compile
[INFO] | +- org.springframework.boot:spring-boot-starter:jar:1.5.3.RELEASE:compile
[INFO] | | +- org.springframework.boot:spring-boot:jar:1.5.3.RELEASE:compile
[INFO] | | +- org.springframework.boot:spring-boot-autoconfigure:jar:1.5.3.RELEASE:compile
[INFO] | | +- org.springframework.boot:spring-boot-starter-logging:jar:1.5.3.RELEASE:compile
[INFO] | | | +- org.slf4j:jul-to-slf4j:jar:1.7.25:compile
[INFO] | | | \- org.slf4j:log4j-over-slf4j:jar:1.7.25:compile
[INFO] | | \- org.yaml:snakeyaml:jar:1.17:runtime
[INFO] | +- org.thymeleaf:thymeleaf-spring4:jar:2.1.5.RELEASE:compile
[INFO] | | \- org.thymeleaf:thymeleaf:jar:2.1.5.RELEASE:compile
[INFO] | | +- ognl:ognl:jar:3.0.8:compile
[INFO] | | \- org.unbescape:unbescape:jar:1.1.0.RELEASE:compile
[INFO] | \- nz.net.ultraq.thymeleaf:thymeleaf-layout-dialect:jar:1.4.0:compile
[INFO] | \- org.codehaus.groovy:groovy:jar:2.4.10:compile
[INFO] +- org.springframework.boot:spring-boot-starter-web:jar:1.5.3.RELEASE:compile
[INFO] | +- org.springframework.boot:spring-boot-starter-tomcat:jar:1.5.3.RELEASE:compile
[INFO] | | +- org.apache.tomcat.embed:tomcat-embed-core:jar:8.5.14:compile
[INFO] | | +- org.apache.tomcat.embed:tomcat-embed-el:jar:8.5.14:compile
[INFO] | | \- org.apache.tomcat.embed:tomcat-embed-websocket:jar:8.5.14:compile
[INFO] | +- org.hibernate:hibernate-validator:jar:5.3.5.Final:compile
[INFO] | | +- javax.validation:validation-api:jar:1.1.0.Final:compile
[INFO] | | +- org.jboss.logging:jboss-logging:jar:3.3.1.Final:compile
[INFO] | | \- com.fasterxml:classmate:jar:1.3.3:compile
[INFO] | +- com.fasterxml.jackson.core:jackson-databind:jar:2.8.8:compile
[INFO] | | +- com.fasterxml.jackson.core:jackson-annotations:jar:2.8.0:compile
[INFO] | | \- com.fasterxml.jackson.core:jackson-core:jar:2.8.8:compile
[INFO] | +- org.springframework:spring-web:jar:4.3.8.RELEASE:compile
[INFO] | | \- org.springframework:spring-beans:jar:4.3.8.RELEASE:compile
[INFO] | \- org.springframework:spring-webmvc:jar:4.3.8.RELEASE:compile
[INFO] | \- org.springframework:spring-expression:jar:4.3.8.RELEASE:compile
[INFO] +- org.springframework.boot:spring-boot-starter-security:jar:1.5.3.RELEASE:compile
[INFO] | +- org.springframework:spring-aop:jar:4.3.8.RELEASE:compile
[INFO] | +- org.springframework.security:spring-security-config:jar:4.2.2.RELEASE:compile
[INFO] | | \- org.springframework.security:spring-security-core:jar:4.2.2.RELEASE:compile
[INFO] | \- org.springframework.security:spring-security-web:jar:4.2.2.RELEASE:compile
[INFO] +- org.springframework.boot:spring-boot-starter-data-jpa:jar:1.5.3.RELEASE:compile
[INFO] | +- org.springframework.boot:spring-boot-starter-aop:jar:1.5.3.RELEASE:compile
[INFO] | | \- org.aspectj:aspectjweaver:jar:1.8.10:compile
[INFO] | +- org.springframework.boot:spring-boot-starter-jdbc:jar:1.5.3.RELEASE:compile
[INFO] | | +- org.apache.tomcat:tomcat-jdbc:jar:8.5.14:compile
[INFO] | | | \- org.apache.tomcat:tomcat-juli:jar:8.5.14:compile
[INFO] | | \- org.springframework:spring-jdbc:jar:4.3.8.RELEASE:compile
[INFO] | +- org.hibernate:hibernate-core:jar:5.0.12.Final:compile
[INFO] | | +- org.hibernate.javax.persistence:hibernate-jpa-2.1-api:jar:1.0.0.Final:compile
[INFO] | | +- org.javassist:javassist:jar:3.21.0-GA:compile
[INFO] | | +- antlr:antlr:jar:2.7.7:compile
[INFO] | | +- org.jboss:jandex:jar:2.0.0.Final:compile
[INFO] | | +- dom4j:dom4j:jar:1.6.1:compile
[INFO] | | \- org.hibernate.common:hibernate-commons-annotations:jar:5.0.1.Final:compile
[INFO] | +- org.hibernate:hibernate-entitymanager:jar:5.0.12.Final:compile
[INFO] | +- javax.transaction:javax.transaction-api:jar:1.2:compile
[INFO] | +- org.springframework.data:spring-data-jpa:jar:1.11.3.RELEASE:compile
[INFO] | | +- org.springframework.data:spring-data-commons:jar:1.13.3.RELEASE:compile
[INFO] | | +- org.springframework:spring-orm:jar:4.3.8.RELEASE:compile
[INFO] | | +- org.springframework:spring-tx:jar:4.3.8.RELEASE:compile
[INFO] | | \- org.slf4j:jcl-over-slf4j:jar:1.7.25:compile
[INFO] | \- org.springframework:spring-aspects:jar:4.3.8.RELEASE:compile
[INFO] +- com.h2database:h2:jar:1.4.194:compile
[INFO] +- org.springframework.boot:spring-boot-starter-test:jar:1.5.3.RELEASE:test
[INFO] | +- org.springframework.boot:spring-boot-test:jar:1.5.3.RELEASE:test
[INFO] | +- org.springframework.boot:spring-boot-test-autoconfigure:jar:1.5.3.RELEASE:test
[INFO] | +- com.jayway.jsonpath:json-path:jar:2.2.0:test
[INFO] | | \- net.minidev:json-smart:jar:2.2.1:test
[INFO] | | \- net.minidev:accessors-smart:jar:1.1:test
[INFO] | | \- org.ow2.asm:asm:jar:5.0.3:test
[INFO] | +- junit:junit:jar:4.12:test
[INFO] | +- org.assertj:assertj-core:jar:2.6.0:test
[INFO] | +- org.mockito:mockito-core:jar:1.10.19:test
[INFO] | | \- org.objenesis:objenesis:jar:2.1:test
[INFO] | +- org.hamcrest:hamcrest-core:jar:1.3:test
[INFO] | +- org.hamcrest:hamcrest-library:jar:1.3:test
[INFO] | +- org.skyscreamer:jsonassert:jar:1.4.0:test
[INFO] | | \- com.vaadin.external.google:android-json:jar:0.0.20131108.vaadin1:test
[INFO] | +- org.springframework:spring-core:jar:4.3.8.RELEASE:compile
[INFO] | \- org.springframework:spring-test:jar:4.3.8.RELEASE:test
[INFO] +- org.thymeleaf.extras:thymeleaf-extras-springsecurity4:jar:2.1.3.RELEASE:compile
[INFO] | \- org.slf4j:slf4j-api:jar:1.7.25:compile
[INFO] +- org.springframework.boot:spring-boot-starter-mail:jar:1.5.3.RELEASE:compile
[INFO] | +- org.springframework:spring-context:jar:4.3.8.RELEASE:compile
[INFO] | +- org.springframework:spring-context-support:jar:4.3.8.RELEASE:compile
[INFO] | \- com.sun.mail:javax.mail:jar:1.5.6:compile
[INFO] | \- javax.activation:activation:jar:1.1:compile
[INFO] +- ch.qos.logback:logback-classic:jar:1.1.11:compile
[INFO] | \- ch.qos.logback:logback-core:jar:1.1.11:compile
[INFO] +- org.webjars:bootstrap:jar:3.3.7-1:compile
[INFO] \- org.webjars:jquery:jar:3.2.0:compile
[INFO] ------------------------------------------------------------------------
[INFO] BUILD SUCCESS
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 1.189 s
[INFO] Finished at: 2017-04-23T20:10:12+02:00
[INFO] Final Memory: 25M/437M
[INFO] ------------------------------------------------------------------------

Try to add this dependency to your pom.xml:
<dependency>
<groupId>org.hibernate</groupId>
<artifactId>hibernate-core</artifactId>
<version>4.3.11.Final</version>
</dependency>

I have a similar issue and I found that the latest spring-data-jpa of spring boot 2.0.0 jar is not compatible with hibernate-core jar
The solution on my side was downgrade the project to older version of spring boot , so from 2.0.0 tp 1.5.5

Yes. The above comments about downgrading are absolutely right.It seems that spring boot version does not handle dependency version between spring data and hibernate core correctly. By downgrading to spring boot 1.5.5 all errors are gone

I'm experiencing the same issue with the following POM:
<?xml version="1.0" encoding="UTF-8"?>
<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">
<modelVersion>4.0.0</modelVersion>
<groupId>dzone.springboot.mysql</groupId>
<artifactId>dzone-springboot-mysql-test</artifactId>
<version>0.0.1-SNAPSHOT</version>
<packaging>jar</packaging>
<name>dzone-springboot-mysql-test</name>
<description>Testing out Spring Boot and MySQL</description>
<parent>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-parent</artifactId>
<version>1.5.6.RELEASE</version>
<relativePath /> <!-- lookup parent from repository -->
</parent>
<properties>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
<project.reporting.outputEncoding>UTF-8</project.reporting.outputEncoding>
<java.version>1.8</java.version>
</properties>
<dependencies>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-data-jpa</artifactId>
</dependency>
<dependency>
<groupId>mysql</groupId>
<artifactId>mysql-connector-java</artifactId>
</dependency>
<dependency>
<groupId>org.springframework.data</groupId>
<artifactId>spring-data-commons</artifactId>
</dependency>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-test</artifactId>
<scope>test</scope>
</dependency>
</dependencies>
<build>
<plugins>
<plugin>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-maven-plugin</artifactId>
</plugin>
</plugins>
</build>
</project>
This is the output from mvn dependency:tree:
[INFO] --- maven-dependency-plugin:2.10:tree (default-cli) # dzone-springboot-mysql-test ---
[INFO] dzone.springboot.mysql:dzone-springboot-mysql-test:jar:0.0.1-SNAPSHOT
[INFO] +- org.springframework.boot:spring-boot-starter-data-jpa:jar:1.5.6.RELEASE:compile
[INFO] | +- org.springframework.boot:spring-boot-starter:jar:1.5.6.RELEASE:compile
. . .
[INFO] | +- org.hibernate:hibernate-core:jar:5.0.12.Final:compile
[INFO] | | +- org.jboss.logging:jboss-logging:jar:3.3.1.Final:compile
[INFO] | | +- org.hibernate.javax.persistence:hibernate-jpa-2.1-api:jar:1.0.0.Final:compile
[INFO] | | +- org.javassist:javassist:jar:3.21.0-GA:compile
[INFO] | | +- antlr:antlr:jar:2.7.7:compile
[INFO] | | +- org.jboss:jandex:jar:2.0.0.Final:compile
[INFO] | | +- dom4j:dom4j:jar:1.6.1:compile
[INFO] | | \- org.hibernate.common:hibernate-commons-annotations:jar:5.0.1.Final:compile
[INFO] | +- org.hibernate:hibernate-entitymanager:jar:5.0.12.Final:compile
[INFO] | +- javax.transaction:javax.transaction-api:jar:1.2:compile
[INFO] | +- org.springframework.data:spring-data-jpa:jar:1.11.6.RELEASE:compile
[INFO] | | +- org.springframework:spring-orm:jar:4.3.10.RELEASE:compile
[INFO] | | +- org.springframework:spring-context:jar:4.3.10.RELEASE:compile
[INFO] | | | \- org.springframework:spring-expression:jar:4.3.10.RELEASE:compile
[INFO] | | \- org.springframework:spring-tx:jar:4.3.10.RELEASE:compile
[INFO] | \- org.springframework:spring-aspects:jar:4.3.10.RELEASE:compile
. . .
This is the (relevant) stacktrace I get:
. ____ _ __ _ _
/\\ / ___'_ __ _ _(_)_ __ __ _ \ \ \ \
( ( )\___ | '_ | '_| | '_ \/ _` | \ \ \ \
\\/ ___)| |_)| | | | | || (_| | ) ) ) )
' |____| .__|_| |_|_| |_\__, | / / / /
=========|_|==============|___/=/_/_/_/
:: Spring Boot :: (v1.5.6.RELEASE)
2017-11-22 11:52:04 ERROR o.s.boot.SpringApplication - Application startup failed
org.springframework.beans.factory.UnsatisfiedDependencyException: Error creating bean with name 'entityManagerFactory' defined in class path resource [org/springframework/boot/autoconfigure/orm/jpa/HibernateJpaAutoConfiguration.class]: Unsatisfied dependency expressed through method 'entityManagerFactory' parameter 0; nested exception is org.springframework.beans.factory.UnsatisfiedDependencyException: Error creating bean with name 'entityManagerFactoryBuilder' defined in class path resource [org/springframework/boot/autoconfigure/orm/jpa/HibernateJpaAutoConfiguration.class]: Unsatisfied dependency expressed through method 'entityManagerFactoryBuilder' parameter 0; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'jpaVendorAdapter' defined in class path resource [org/springframework/boot/autoconfigure/orm/jpa/HibernateJpaAutoConfiguration.class]: Bean instantiation via factory method failed; nested exception is org.springframework.beans.BeanInstantiationException: Failed to instantiate [org.springframework.orm.jpa.JpaVendorAdapter]: Factory method 'jpaVendorAdapter' threw exception; nested exception is java.lang.NoClassDefFoundError: org/hibernate/HibernateException
at org.springframework.beans.factory.support.ConstructorResolver.createArgumentArray(ConstructorResolver.java:749)
at org.springframework.beans.factory.support.ConstructorResolver.instantiateUsingFactoryMethod(ConstructorResolver.java:467)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.instantiateUsingFactoryMethod(AbstractAutowireCapableBeanFactory.java:1173)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBeanInstance(AbstractAutowireCapableBeanFactory.java:1067)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:513)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:483)
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.context.support.AbstractApplicationContext.getBean(AbstractApplicationContext.java:1078)
at org.springframework.context.support.AbstractApplicationContext.finishBeanFactoryInitialization(AbstractApplicationContext.java:857)
at org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:543)
at org.springframework.boot.SpringApplication.refresh(SpringApplication.java:693)
at org.springframework.boot.SpringApplication.refreshContext(SpringApplication.java:360)
at org.springframework.boot.SpringApplication.run(SpringApplication.java:303)
at org.springframework.boot.test.context.SpringBootContextLoader.loadContext(SpringBootContextLoader.java:120)
at org.springframework.test.context.cache.DefaultCacheAwareContextLoaderDelegate.loadContextInternal(DefaultCacheAwareContextLoaderDelegate.java:98)
at org.springframework.test.context.cache.DefaultCacheAwareContextLoaderDelegate.loadContext(DefaultCacheAwareContextLoaderDelegate.java:116)
at org.springframework.test.context.support.DefaultTestContext.getApplicationContext(DefaultTestContext.java:83)
at org.springframework.boot.test.autoconfigure.SpringBootDependencyInjectionTestExecutionListener.outputConditionEvaluationReport(SpringBootDependencyInjectionTestExecutionListener.java:54)
at org.springframework.boot.test.autoconfigure.SpringBootDependencyInjectionTestExecutionListener.prepareTestInstance(SpringBootDependencyInjectionTestExecutionListener.java:47)
at org.springframework.test.context.TestContextManager.prepareTestInstance(TestContextManager.java:230)
at org.springframework.test.context.junit4.SpringJUnit4ClassRunner.createTest(SpringJUnit4ClassRunner.java:228)
at org.springframework.test.context.junit4.SpringJUnit4ClassRunner$1.runReflectiveCall(SpringJUnit4ClassRunner.java:287)
at org.junit.internal.runners.model.ReflectiveCallable.run(ReflectiveCallable.java:12)
at org.springframework.test.context.junit4.SpringJUnit4ClassRunner.methodBlock(SpringJUnit4ClassRunner.java:289)
at org.springframework.test.context.junit4.SpringJUnit4ClassRunner.runChild(SpringJUnit4ClassRunner.java:247)
at org.springframework.test.context.junit4.SpringJUnit4ClassRunner.runChild(SpringJUnit4ClassRunner.java:94)
at org.junit.runners.ParentRunner$3.run(ParentRunner.java:290)
at org.junit.runners.ParentRunner$1.schedule(ParentRunner.java:71)
at org.junit.runners.ParentRunner.runChildren(ParentRunner.java:288)
at org.junit.runners.ParentRunner.access$000(ParentRunner.java:58)
at org.junit.runners.ParentRunner$2.evaluate(ParentRunner.java:268)
at org.springframework.test.context.junit4.statements.RunBeforeTestClassCallbacks.evaluate(RunBeforeTestClassCallbacks.java:61)
at org.springframework.test.context.junit4.statements.RunAfterTestClassCallbacks.evaluate(RunAfterTestClassCallbacks.java:70)
at org.junit.runners.ParentRunner.run(ParentRunner.java:363)
at org.springframework.test.context.junit4.SpringJUnit4ClassRunner.run(SpringJUnit4ClassRunner.java:191)
at org.eclipse.jdt.internal.junit4.runner.JUnit4TestReference.run(JUnit4TestReference.java:86)
at org.eclipse.jdt.internal.junit.runner.TestExecution.run(TestExecution.java:38)
at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner.java:459)
at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner.java:678)
at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.run(RemoteTestRunner.java:382)
at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.main(RemoteTestRunner.java:192)
. . .
Caused by: java.lang.ClassNotFoundException: org.hibernate.HibernateException
at java.net.URLClassLoader.findClass(URLClassLoader.java:381)
at java.lang.ClassLoader.loadClass(ClassLoader.java:424)
at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:335)
at java.lang.ClassLoader.loadClass(ClassLoader.java:357)
... 85 common frames omitted
As I've been experimenting a bit with spring boot lately, I've discovered that for many dependencies the starter project functionality does not playnice with the dependency handling, except for Spring Boot 1.4.1.RELEASE. When I changed Spring Boot version like this:
<parent>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-parent</artifactId>
<version>1.4.1.RELEASE</version>
<relativePath /> <!-- lookup parent from repository -->
</parent>
... it all works perfectly. As one might expect, mvn dependency:tree reveals the dependency changes. Here's a unified diff view of the changes:
--- /home/rick/projects/dzone-springboot-mysql-test/tree.1.4.1.RELEASE.txt
+++ /home/rick/projects/dzone-springboot-mysql-test/tree.1.5.6.RELEASE.txt
## -27,66 +6,65 ##
[INFO]
[INFO] --- maven-dependency-plugin:2.10:tree (default-cli) # dzone-springboot-mysql-test ---
[INFO] dzone.springboot.mysql:dzone-springboot-mysql-test:jar:0.0.1-SNAPSHOT
-[INFO] +- org.springframework.boot:spring-boot-starter-data-jpa:jar:1.4.1.RELEASE:compile
-[INFO] | +- org.springframework.boot:spring-boot-starter:jar:1.4.1.RELEASE:compile
-[INFO] | | +- org.springframework.boot:spring-boot:jar:1.4.1.RELEASE:compile
-[INFO] | | +- org.springframework.boot:spring-boot-autoconfigure:jar:1.4.1.RELEASE:compile
-[INFO] | | +- org.springframework.boot:spring-boot-starter-logging:jar:1.4.1.RELEASE:compile
-[INFO] | | | +- ch.qos.logback:logback-classic:jar:1.1.7:compile
-[INFO] | | | | \- ch.qos.logback:logback-core:jar:1.1.7:compile
-[INFO] | | | +- org.slf4j:jul-to-slf4j:jar:1.7.21:compile
-[INFO] | | | \- org.slf4j:log4j-over-slf4j:jar:1.7.21:compile
+[INFO] +- org.springframework.boot:spring-boot-starter-data-jpa:jar:1.5.6.RELEASE:compile
+[INFO] | +- org.springframework.boot:spring-boot-starter:jar:1.5.6.RELEASE:compile
+[INFO] | | +- org.springframework.boot:spring-boot:jar:1.5.6.RELEASE:compile
+[INFO] | | +- org.springframework.boot:spring-boot-autoconfigure:jar:1.5.6.RELEASE:compile
+[INFO] | | +- org.springframework.boot:spring-boot-starter-logging:jar:1.5.6.RELEASE:compile
+[INFO] | | | +- ch.qos.logback:logback-classic:jar:1.1.11:compile
+[INFO] | | | | \- ch.qos.logback:logback-core:jar:1.1.11:compile
+[INFO] | | | +- org.slf4j:jul-to-slf4j:jar:1.7.25:compile
+[INFO] | | | \- org.slf4j:log4j-over-slf4j:jar:1.7.25:compile
[INFO] | | \- org.yaml:snakeyaml:jar:1.17:runtime
-[INFO] | +- org.springframework.boot:spring-boot-starter-aop:jar:1.4.1.RELEASE:compile
-[INFO] | | +- org.springframework:spring-aop:jar:4.3.3.RELEASE:compile
-[INFO] | | \- org.aspectj:aspectjweaver:jar:1.8.9:compile
-[INFO] | +- org.springframework.boot:spring-boot-starter-jdbc:jar:1.4.1.RELEASE:compile
-[INFO] | | +- org.apache.tomcat:tomcat-jdbc:jar:8.5.5:compile
-[INFO] | | | \- org.apache.tomcat:tomcat-juli:jar:8.5.5:compile
-[INFO] | | \- org.springframework:spring-jdbc:jar:4.3.3.RELEASE:compile
-[INFO] | +- org.hibernate:hibernate-core:jar:5.0.11.Final:compile
-[INFO] | | +- org.jboss.logging:jboss-logging:jar:3.3.0.Final:compile
+[INFO] | +- org.springframework.boot:spring-boot-starter-aop:jar:1.5.6.RELEASE:compile
+[INFO] | | +- org.springframework:spring-aop:jar:4.3.10.RELEASE:compile
+[INFO] | | \- org.aspectj:aspectjweaver:jar:1.8.10:compile
+[INFO] | +- org.springframework.boot:spring-boot-starter-jdbc:jar:1.5.6.RELEASE:compile
+[INFO] | | +- org.apache.tomcat:tomcat-jdbc:jar:8.5.16:compile
+[INFO] | | | \- org.apache.tomcat:tomcat-juli:jar:8.5.16:compile
+[INFO] | | \- org.springframework:spring-jdbc:jar:4.3.10.RELEASE:compile
+[INFO] | +- org.hibernate:hibernate-core:jar:5.0.12.Final:compile
+[INFO] | | +- org.jboss.logging:jboss-logging:jar:3.3.1.Final:compile
[INFO] | | +- org.hibernate.javax.persistence:hibernate-jpa-2.1-api:jar:1.0.0.Final:compile
-[INFO] | | +- org.javassist:javassist:jar:3.20.0-GA:compile
+[INFO] | | +- org.javassist:javassist:jar:3.21.0-GA:compile
[INFO] | | +- antlr:antlr:jar:2.7.7:compile
[INFO] | | +- org.jboss:jandex:jar:2.0.0.Final:compile
[INFO] | | +- dom4j:dom4j:jar:1.6.1:compile
-[INFO] | | | \- xml-apis:xml-apis:jar:1.4.01:compile
[INFO] | | \- org.hibernate.common:hibernate-commons-annotations:jar:5.0.1.Final:compile
-[INFO] | +- org.hibernate:hibernate-entitymanager:jar:5.0.11.Final:compile
+[INFO] | +- org.hibernate:hibernate-entitymanager:jar:5.0.12.Final:compile
[INFO] | +- javax.transaction:javax.transaction-api:jar:1.2:compile
-[INFO] | +- org.springframework.data:spring-data-jpa:jar:1.10.3.RELEASE:compile
-[INFO] | | +- org.springframework:spring-orm:jar:4.3.3.RELEASE:compile
-[INFO] | | +- org.springframework:spring-context:jar:4.3.3.RELEASE:compile
-[INFO] | | | \- org.springframework:spring-expression:jar:4.3.3.RELEASE:compile
-[INFO] | | \- org.springframework:spring-tx:jar:4.3.3.RELEASE:compile
-[INFO] | \- org.springframework:spring-aspects:jar:4.3.3.RELEASE:compile
-[INFO] +- mysql:mysql-connector-java:jar:5.1.39:compile
-[INFO] +- org.springframework.data:spring-data-commons:jar:1.12.3.RELEASE:compile
-[INFO] | +- org.springframework:spring-core:jar:4.3.3.RELEASE:compile
-[INFO] | +- org.springframework:spring-beans:jar:4.3.3.RELEASE:compile
-[INFO] | +- org.slf4j:slf4j-api:jar:1.7.21:compile
-[INFO] | \- org.slf4j:jcl-over-slf4j:jar:1.7.21:compile
-[INFO] \- org.springframework.boot:spring-boot-starter-test:jar:1.4.1.RELEASE:test
-[INFO] +- org.springframework.boot:spring-boot-test:jar:1.4.1.RELEASE:test
-[INFO] +- org.springframework.boot:spring-boot-test-autoconfigure:jar:1.4.1.RELEASE:test
+[INFO] | +- org.springframework.data:spring-data-jpa:jar:1.11.6.RELEASE:compile
+[INFO] | | +- org.springframework:spring-orm:jar:4.3.10.RELEASE:compile
+[INFO] | | +- org.springframework:spring-context:jar:4.3.10.RELEASE:compile
+[INFO] | | | \- org.springframework:spring-expression:jar:4.3.10.RELEASE:compile
+[INFO] | | \- org.springframework:spring-tx:jar:4.3.10.RELEASE:compile
+[INFO] | \- org.springframework:spring-aspects:jar:4.3.10.RELEASE:compile
+[INFO] +- mysql:mysql-connector-java:jar:5.1.43:compile
+[INFO] +- org.springframework.data:spring-data-commons:jar:1.13.6.RELEASE:compile
+[INFO] | +- org.springframework:spring-core:jar:4.3.10.RELEASE:compile
+[INFO] | +- org.springframework:spring-beans:jar:4.3.10.RELEASE:compile
+[INFO] | +- org.slf4j:slf4j-api:jar:1.7.25:compile
+[INFO] | \- org.slf4j:jcl-over-slf4j:jar:1.7.25:compile
+[INFO] \- org.springframework.boot:spring-boot-starter-test:jar:1.5.6.RELEASE:test
+[INFO] +- org.springframework.boot:spring-boot-test:jar:1.5.6.RELEASE:test
+[INFO] +- org.springframework.boot:spring-boot-test-autoconfigure:jar:1.5.6.RELEASE:test
[INFO] +- com.jayway.jsonpath:json-path:jar:2.2.0:test
[INFO] | \- net.minidev:json-smart:jar:2.2.1:test
[INFO] | \- net.minidev:accessors-smart:jar:1.1:test
[INFO] | \- org.ow2.asm:asm:jar:5.0.3:test
[INFO] +- junit:junit:jar:4.12:test
-[INFO] +- org.assertj:assertj-core:jar:2.5.0:test
+[INFO] +- org.assertj:assertj-core:jar:2.6.0:test
[INFO] +- org.mockito:mockito-core:jar:1.10.19:test
[INFO] | \- org.objenesis:objenesis:jar:2.1:test
[INFO] +- org.hamcrest:hamcrest-core:jar:1.3:test
[INFO] +- org.hamcrest:hamcrest-library:jar:1.3:test
-[INFO] +- org.skyscreamer:jsonassert:jar:1.3.0:test
-[INFO] | \- org.json:json:jar:20140107:test
-[INFO] \- org.springframework:spring-test:jar:4.3.3.RELEASE:test
+[INFO] +- org.skyscreamer:jsonassert:jar:1.4.0:test
+[INFO] | \- com.vaadin.external.google:android-json:jar:0.0.20131108.vaadin1:test
+[INFO] \- org.springframework:spring-test:jar:4.3.10.RELEASE:test
[INFO] ------------------------------------------------------------------------
[INFO] BUILD SUCCESS
[INFO] ------------------------------------------------------------------------
-[INFO] Total time: 3.699 s
-[INFO] Finished at: 2017-11-22T12:02:08-05:00
-[INFO] Final Memory: 23M/252M
+[INFO] Total time: 1.525 s
+[INFO] Finished at: 2017-11-22T12:02:29-05:00
+[INFO] Final Memory: 23M/429M
[INFO] ------------------------------------------------------------------------
Summarizing the changes:
org.springframework.boot:spring-boot-starter-data-jpa:jar:1.5.6.RELEASE
downgraded to
org.springframework.boot:spring-boot-starter-data-jpa:jar:1.4.1.RELEASE
org.hibernate:hibernate-core:jar:5.0.12.Final
downgraded to
org.hibernate:hibernate-core:jar:5.0.11.Final
org.springframework.data:spring-data-jpa:jar:1.11.6.RELEASE
downgraded to
org.springframework.data:spring-data-jpa:jar:1.10.3.RELEASE
At this point I'm not entirely sure which fixed the classpath but now springboot is happily loading the context.
UPDATE: here's a link to the code: https://github.com/rbuitragoc/dzone-springboot-mysql-test

For me, I had
<spring.version>5.0.7.RELEASE</spring.version>
as well as:
<spring.boot.version>1.5.2.RELEASE</spring.boot.version>
Which caused a conflict.
Removing spring.version fixed it.

Related

How do I fix the hibernate validator problem with spring boot and ejb intergration

I am using some of the jars that have ejb services for a spring based rest interface I am trying to build. I am using spring boot for the project. I added the required dependencies, but the application is having issues with hibernate validator. Can someone please look at it and let me know what could be wrong with it? Please find the stack trace below:
org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'defaultValidator' defined in class path resource [org/springframework/boot/autoconfigure/validation/ValidationAutoConfiguration.class]: Bean instantiation via factory method failed; nested exception is org.springframework.beans.BeanInstantiationException: Failed to instantiate [org.springframework.validation.beanvalidation.LocalValidatorFactoryBean]: Factory method 'defaultValidator' threw exception; nested exception is java.lang.NoClassDefFoundError: Could not initialize class org.hibernate.validator.internal.engine.ConfigurationImpl
at org.springframework.beans.factory.support.ConstructorResolver.instantiate(ConstructorResolver.java:627) ~[spring-beans-5.1.9.RELEASE.jar:5.1.9.RELEASE]
at org.springframework.beans.factory.support.ConstructorResolver.instantiateUsingFactoryMethod(ConstructorResolver.java:456) ~[spring-beans-5.1.9.RELEASE.jar:5.1.9.RELEASE]
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.instantiateUsingFactoryMethod(AbstractAutowireCapableBeanFactory.java:1321) ~[spring-beans-5.1.9.RELEASE.jar:5.1.9.RELEASE]
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBeanInstance(AbstractAutowireCapableBeanFactory.java:1160) ~[spring-beans-5.1.9.RELEASE.jar:5.1.9.RELEASE]
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:555) ~[spring-beans-5.1.9.RELEASE.jar:5.1.9.RELEASE]
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:515) ~[spring-beans-5.1.9.RELEASE.jar:5.1.9.RELEASE]
at org.springframework.beans.factory.support.AbstractBeanFactory.lambda$doGetBean$0(AbstractBeanFactory.java:320) ~[spring-beans-5.1.9.RELEASE.jar:5.1.9.RELEASE]
at org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton(DefaultSingletonBeanRegistry.java:222) ~[spring-beans-5.1.9.RELEASE.jar:5.1.9.RELEASE]
at org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:318) ~[spring-beans-5.1.9.RELEASE.jar:5.1.9.RELEASE]
at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:199) ~[spring-beans-5.1.9.RELEASE.jar:5.1.9.RELEASE]
at org.springframework.beans.factory.support.DefaultListableBeanFactory.preInstantiateSingletons(DefaultListableBeanFactory.java:845) ~[spring-beans-5.1.9.RELEASE.jar:5.1.9.RELEASE]
at org.springframework.context.support.AbstractApplicationContext.finishBeanFactoryInitialization(AbstractApplicationContext.java:877) ~[spring-context-5.1.9.RELEASE.jar:5.1.9.RELEASE]
at org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:549) ~[spring-context-5.1.9.RELEASE.jar:5.1.9.RELEASE]
at org.springframework.boot.web.servlet.context.ServletWebServerApplicationContext.refresh(ServletWebServerApplicationContext.java:141) ~[spring-boot-2.1.8.RELEASE.jar:2.1.8.RELEASE]
at org.springframework.boot.SpringApplication.refresh(SpringApplication.java:744) [spring-boot-2.1.8.RELEASE.jar:2.1.8.RELEASE]
at org.springframework.boot.SpringApplication.refreshContext(SpringApplication.java:391) [spring-boot-2.1.8.RELEASE.jar:2.1.8.RELEASE]
at org.springframework.boot.SpringApplication.run(SpringApplication.java:312) [spring-boot-2.1.8.RELEASE.jar:2.1.8.RELEASE]
at org.springframework.boot.SpringApplication.run(SpringApplication.java:1215) [spring-boot-2.1.8.RELEASE.jar:2.1.8.RELEASE]
at org.springframework.boot.SpringApplication.run(SpringApplication.java:1204) [spring-boot-2.1.8.RELEASE.jar:2.1.8.RELEASE]
at com.mrs.MrsApplication.main(MrsApplication.java:25) [classes/:na]
Caused by: org.springframework.beans.BeanInstantiationException: Failed to instantiate [org.springframework.validation.beanvalidation.LocalValidatorFactoryBean]: Factory method 'defaultValidator' threw exception; nested exception is java.lang.NoClassDefFoundError: Could not initialize class org.hibernate.validator.internal.engine.ConfigurationImpl
at org.springframework.beans.factory.support.SimpleInstantiationStrategy.instantiate(SimpleInstantiationStrategy.java:185) ~[spring-beans-5.1.9.RELEASE.jar:5.1.9.RELEASE]
at org.springframework.beans.factory.support.ConstructorResolver.instantiate(ConstructorResolver.java:622) ~[spring-beans-5.1.9.RELEASE.jar:5.1.9.RELEASE]
... 19 common frames omitted
Caused by: java.lang.NoClassDefFoundError: Could not initialize class org.hibernate.validator.internal.engine.ConfigurationImpl
at org.hibernate.validator.HibernateValidator.createGenericConfiguration(HibernateValidator.java:33) ~[hibernate-validator-6.0.17.Final.jar:6.0.17.Final]
at javax.validation.Validation$GenericBootstrapImpl.configure(Validation.java:296) ~[validation-api-2.0.1.Final.jar:na]
at org.springframework.boot.validation.MessageInterpolatorFactory.getObject(MessageInterpolatorFactory.java:53) ~[spring-boot-2.1.8.RELEASE.jar:2.1.8.RELEASE]
at org.springframework.boot.autoconfigure.validation.ValidationAutoConfiguration.defaultValidator(ValidationAutoConfiguration.java:57) ~[spring-boot-autoconfigure-2.1.8.RELEASE.jar:2.1.8.RELEASE]
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) ~[na:1.8.0_151]
at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source) ~[na:1.8.0_151]
at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source) ~[na:1.8.0_151]
at java.lang.reflect.Method.invoke(Unknown Source) ~[na:1.8.0_151]
at org.springframework.beans.factory.support.SimpleInstantiationStrategy.instantiate(SimpleInstantiationStrategy.java:154) ~[spring-beans-5.1.9.RELEASE.jar:5.1.9.RELEASE]
... 20 common frames omitted
Please find the dependencies from the pom.xml below:
<dependency>
<groupId>log4j</groupId>
<artifactId>log4j</artifactId>
<version>1.2.17</version>
</dependency>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-web</artifactId>
<exclusions>
<exclusion>
<groupId>org.hibernate</groupId>
<artifactId>hibernate-validator</artifactId>
</exclusion>
</exclusions>
</dependency>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-web-services</artifactId>
<exclusions>
<exclusion>
<groupId>org.hibernate</groupId>
<artifactId>hibernate-validator</artifactId>
</exclusion>
</exclusions>
</dependency>
<dependency>
<groupId>com.google.code.gson</groupId>
<artifactId>gson</artifactId>
</dependency>
<dependency>
<groupId>org.jboss.logging</groupId>
<artifactId>jboss-logging</artifactId>
<version>3.3.3.Final</version>
</dependency>
<dependency>
<groupId>javax.validation</groupId>
<artifactId>validation-api</artifactId>
</dependency>
Please find the mvn dependency tree below:
[INFO]
[INFO] --- maven-dependency-plugin:3.1.1:tree (default-cli) # mrs ---
[INFO] com.mrs:mrs:jar:0.0.1-SNAPSHOT
[INFO] +- log4j:log4j:jar:1.2.17:compile
[INFO] +- org.springframework.boot:spring-boot-starter-web:jar:2.1.8.RELEASE:compile
[INFO] | +- org.springframework.boot:spring-boot-starter:jar:2.1.8.RELEASE:compile
[INFO] | | +- org.springframework.boot:spring-boot:jar:2.1.8.RELEASE:compile
[INFO] | | +- org.springframework.boot:spring-boot-autoconfigure:jar:2.1.8.RELEASE:compile
[INFO] | | +- org.springframework.boot:spring-boot-starter-logging:jar:2.1.8.RELEASE:compile
[INFO] | | | +- ch.qos.logback:logback-classic:jar:1.2.3:compile
[INFO] | | | | +- ch.qos.logback:logback-core:jar:1.2.3:compile
[INFO] | | | | \- org.slf4j:slf4j-api:jar:1.7.28:compile
[INFO] | | | +- org.apache.logging.log4j:log4j-to-slf4j:jar:2.11.2:compile
[INFO] | | | | \- org.apache.logging.log4j:log4j-api:jar:2.11.2:compile
[INFO] | | | \- org.slf4j:jul-to-slf4j:jar:1.7.28:compile
[INFO] | | +- javax.annotation:javax.annotation-api:jar:1.3.2:compile
[INFO] | | +- org.springframework:spring-core:jar:5.1.9.RELEASE:compile
[INFO] | | | \- org.springframework:spring-jcl:jar:5.1.9.RELEASE:compile
[INFO] | | \- org.yaml:snakeyaml:jar:1.23:runtime
[INFO] | +- org.springframework.boot:spring-boot-starter-json:jar:2.1.8.RELEASE:compile
[INFO] | | +- com.fasterxml.jackson.core:jackson-databind:jar:2.9.9.3:compile
[INFO] | | | +- com.fasterxml.jackson.core:jackson-annotations:jar:2.9.0:compile
[INFO] | | | \- com.fasterxml.jackson.core:jackson-core:jar:2.9.9:compile
[INFO] | | +- com.fasterxml.jackson.datatype:jackson-datatype-jdk8:jar:2.9.9:compile
[INFO] | | +- com.fasterxml.jackson.datatype:jackson-datatype-jsr310:jar:2.9.9:compile
[INFO] | | \- com.fasterxml.jackson.module:jackson-module-parameter-names:jar:2.9.9:compile
[INFO] | +- org.springframework.boot:spring-boot-starter-tomcat:jar:2.1.8.RELEASE:compile
[INFO] | | +- org.apache.tomcat.embed:tomcat-embed-core:jar:9.0.24:compile
[INFO] | | +- org.apache.tomcat.embed:tomcat-embed-el:jar:9.0.24:compile
[INFO] | | \- org.apache.tomcat.embed:tomcat-embed-websocket:jar:9.0.24:compile
[INFO] | +- org.hibernate.validator:hibernate-validator:jar:6.0.17.Final:compile
[INFO] | | \- com.fasterxml:classmate:jar:1.4.0:compile
[INFO] | +- org.springframework:spring-web:jar:5.1.9.RELEASE:compile
[INFO] | | \- org.springframework:spring-beans:jar:5.1.9.RELEASE:compile
[INFO] | \- org.springframework:spring-webmvc:jar:5.1.9.RELEASE:compile
[INFO] | +- org.springframework:spring-aop:jar:5.1.9.RELEASE:compile
[INFO] | +- org.springframework:spring-context:jar:5.1.9.RELEASE:compile
[INFO] | \- org.springframework:spring-expression:jar:5.1.9.RELEASE:compile
[INFO] +- org.springframework.boot:spring-boot-starter-web-services:jar:2.1.8.RELEASE:compile
[INFO] | +- com.sun.xml.messaging.saaj:saaj-impl:jar:1.5.0:compile
[INFO] | | +- javax.xml.soap:javax.xml.soap-api:jar:1.4.0:compile
[INFO] | | +- org.jvnet.mimepull:mimepull:jar:1.9.11:compile
[INFO] | | \- org.jvnet.staxex:stax-ex:jar:1.8:compile
[INFO] | +- javax.xml.ws:jaxws-api:jar:2.3.1:compile
[INFO] | | \- javax.xml.bind:jaxb-api:jar:2.3.1:compile
[INFO] | | \- javax.activation:javax.activation-api:jar:1.2.0:compile
[INFO] | +- org.springframework:spring-oxm:jar:5.1.9.RELEASE:compile
[INFO] | \- org.springframework.ws:spring-ws-core:jar:3.0.7.RELEASE:compile
[INFO] | +- org.springframework.ws:spring-xml:jar:3.0.7.RELEASE:compile
[INFO] | \- commons-io:commons-io:jar:2.5:compile
[INFO] +- com.google.code.gson:gson:jar:2.8.5:compile
[INFO] +- org.jboss.logging:jboss-logging:jar:3.3.3.Final:compile
[INFO] \- javax.validation:validation-api:jar:2.0.1.Final:compile
You need to add spring-boot-starter-validation to your pom.xml
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-validation</artifactId>
</dependency>
The issue is for a spring-boot-starter-web adds a dependency to hibernate-validator, however spring needs to be added a default validator of hibernate as dependency.
Then you should exclude and add that dependency with latest version:
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-web</artifactId>
<exclusions>
<exclusion>
<groupId>org.hibernate</groupId>
<artifactId>hibernate-validator</artifactId>
</exclusion>
</exclusions>
</dependency>
<dependency>
<groupId>org.hibernate</groupId>
<artifactId>hibernate-validator</artifactId>
<version>6.0.17.Final</version>
</dependency>

Caused by: java.lang.BootstrapMethodError: java.lang.NoClassDefFoundError: redis/clients/jedis/Tuple - Redis Spring Boot

I am using Spring Data Redis example. In this example, simply trying to connect to the redis DB. Runnning the main method, I am getting below error.
Spring Boot version used is v 2.0.3.RELEASE & Redis version is 2.4.5.
Code reference taken from : http://javasampleapproach.com/spring-framework/spring-data/spring-data-redis-example-spring-boot-redis-example and https://docs.spring.io/spring-session/docs/current/reference/html5/guides/boot-redis.html. Can anybody please suggest what is wrong here ?
Caused by: org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'jedisConnectionFactory' defined in class path resource [com/javasampleapproach/redis/config/RedisConfig.class]: Bean instantiation via factory method failed; nested exception is org.springframework.beans.BeanInstantiationException: Failed to instantiate [org.springframework.data.redis.connection.jedis.JedisConnectionFactory]: Factory method 'jedisConnectionFactory' threw exception; nested exception is java.lang.BootstrapMethodError: java.lang.NoClassDefFoundError: redis/clients/jedis/Tuple
at org.springframework.beans.factory.support.ConstructorResolver.instantiateUsingFactoryMethod(ConstructorResolver.java:590) ~[spring-beans-5.0.7.RELEASE.jar:5.0.7.RELEASE]
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.instantiateUsingFactoryMethod(AbstractAutowireCapableBeanFactory.java:1256) ~[spring-beans-5.0.7.RELEASE.jar:5.0.7.RELEASE]
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBeanInstance(AbstractAutowireCapableBeanFactory.java:1105) ~[spring-beans-5.0.7.RELEASE.jar:5.0.7.RELEASE]
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:543) ~[spring-beans-5.0.7.RELEASE.jar:5.0.7.RELEASE]
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:503) ~[spring-beans-5.0.7.RELEASE.jar:5.0.7.RELEASE]
at org.springframework.beans.factory.support.AbstractBeanFactory.lambda$doGetBean$0(AbstractBeanFactory.java:317) ~[spring-beans-5.0.7.RELEASE.jar:5.0.7.RELEASE]
at org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton(DefaultSingletonBeanRegistry.java:222) ~[spring-beans-5.0.7.RELEASE.jar:5.0.7.RELEASE]
at org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:315) ~[spring-beans-5.0.7.RELEASE.jar:5.0.7.RELEASE]
at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:199) ~[spring-beans-5.0.7.RELEASE.jar:5.0.7.RELEASE]
at org.springframework.beans.factory.config.DependencyDescriptor.resolveCandidate(DependencyDescriptor.java:251) ~[spring-beans-5.0.7.RELEASE.jar:5.0.7.RELEASE]
at org.springframework.beans.factory.support.DefaultListableBeanFactory.addCandidateEntry(DefaultListableBeanFactory.java:1325) ~[spring-beans-5.0.7.RELEASE.jar:5.0.7.RELEASE]
at org.springframework.beans.factory.support.DefaultListableBeanFactory.findAutowireCandidates(DefaultListableBeanFactory.java:1291) ~[spring-beans-5.0.7.RELEASE.jar:5.0.7.RELEASE]
at org.springframework.beans.factory.support.DefaultListableBeanFactory.resolveMultipleBeans(DefaultListableBeanFactory.java:1218) ~[spring-beans-5.0.7.RELEASE.jar:5.0.7.RELEASE]
at org.springframework.beans.factory.support.DefaultListableBeanFactory.doResolveDependency(DefaultListableBeanFactory.java:1096) ~[spring-beans-5.0.7.RELEASE.jar:5.0.7.RELEASE]
at org.springframework.beans.factory.support.DefaultListableBeanFactory.resolveDependency(DefaultListableBeanFactory.java:1065) ~[spring-beans-5.0.7.RELEASE.jar:5.0.7.RELEASE]
at org.springframework.beans.factory.support.ConstructorResolver.resolveAutowiredArgument(ConstructorResolver.java:818) ~[spring-beans-5.0.7.RELEASE.jar:5.0.7.RELEASE]
at org.springframework.beans.factory.support.ConstructorResolver.createArgumentArray(ConstructorResolver.java:724) ~[spring-beans-5.0.7.RELEASE.jar:5.0.7.RELEASE]
... 82 common frames omitted
Caused by: org.springframework.beans.BeanInstantiationException: Failed to instantiate [org.springframework.data.redis.connection.jedis.JedisConnectionFactory]: Factory method 'jedisConnectionFactory' threw exception; nested exception is java.lang.BootstrapMethodError: java.lang.NoClassDefFoundError: redis/clients/jedis/Tuple
at org.springframework.beans.factory.support.SimpleInstantiationStrategy.instantiate(SimpleInstantiationStrategy.java:185) ~[spring-beans-5.0.7.RELEASE.jar:5.0.7.RELEASE]
at org.springframework.beans.factory.support.ConstructorResolver.instantiateUsingFactoryMethod(ConstructorResolver.java:582) ~[spring-beans-5.0.7.RELEASE.jar:5.0.7.RELEASE]
... 98 common frames omitted
Caused by: java.lang.BootstrapMethodError: java.lang.NoClassDefFoundError: redis/clients/jedis/Tuple
at org.springframework.data.redis.connection.jedis.JedisConverters.<clinit>(JedisConverters.java:124) ~[spring-data-redis-2.0.8.RELEASE.jar:2.0.8.RELEASE]
at org.springframework.data.redis.connection.jedis.JedisConnectionFactory.<clinit>(JedisConnectionFactory.java:92) ~[spring-data-redis-2.0.8.RELEASE.jar:2.0.8.RELEASE]
at com.javasampleapproach.redis.config.RedisConfig.jedisConnectionFactory(RedisConfig.java:16) ~[classes/:na]
at com.javasampleapproach.redis.config.RedisConfig$$EnhancerBySpringCGLIB$$8b8821c.CGLIB$jedisConnectionFactory$1(<generated>) ~[classes/:na]
at com.javasampleapproach.redis.config.RedisConfig$$EnhancerBySpringCGLIB$$8b8821c$$FastClassBySpringCGLIB$$8d807fb2.invoke(<generated>) ~[classes/:na]
at org.springframework.cglib.proxy.MethodProxy.invokeSuper(MethodProxy.java:228) ~[spring-core-5.0.7.RELEASE.jar:5.0.7.RELEASE]
at org.springframework.context.annotation.ConfigurationClassEnhancer$BeanMethodInterceptor.intercept(ConfigurationClassEnhancer.java:361) ~[spring-context-5.0.7.RELEASE.jar:5.0.7.RELEASE]
at com.javasampleapproach.redis.config.RedisConfig$$EnhancerBySpringCGLIB$$8b8821c.jedisConnectionFactory(<generated>) ~[classes/:na]
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) ~[na:1.8.0_151]
at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source) ~[na:1.8.0_151]
at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source) ~[na:1.8.0_151]
at java.lang.reflect.Method.invoke(Unknown Source) ~[na:1.8.0_151]
at org.springframework.beans.factory.support.SimpleInstantiationStrategy.instantiate(SimpleInstantiationStrategy.java:154) ~[spring-beans-5.0.7.RELEASE.jar:5.0.7.RELEASE]
... 99 common frames omitted
Caused by: java.lang.NoClassDefFoundError: redis/clients/jedis/Tuple
... 112 common frames omitted
Caused by: java.lang.ClassNotFoundException: redis.clients.jedis.Tuple
at java.net.URLClassLoader.findClass(Unknown Source) ~[na:1.8.0_151]
at java.lang.ClassLoader.loadClass(Unknown Source) ~[na:1.8.0_151]
at sun.misc.Launcher$AppClassLoader.loadClass(Unknown Source) ~[na:1.8.0_151]
at java.lang.ClassLoader.loadClass(Unknown Source) ~[na:1.8.0_151]
... 112 common frames omitted
application.properties
# Session store type.
spring.session.store-type=redis
spring.session.redis.flush-mode=on-save
spring.session.redis.namespace=spring:session
#Configuring the Redis Connection
# Redis server host.
spring.redis.host=localhost
# Login password of the redis server.
spring.redis.password=
# Redis server port.
spring.redis.port=6379
Customer.java
#Data
#Builder
public class Customer implements Serializable{
private static final long serialVersionUID = 1L;
private long id;
private String firstName;
private String lastName;
}
RedisConfig.java
#Configuration
#ComponentScan("com.javasampleapproach.redis")
public class RedisConfig {
#Bean
public JedisConnectionFactory jedisConnectionFactory() {
return new JedisConnectionFactory();
}
#Bean
public RedisTemplate<String, Object> redisTemplate(){
final RedisTemplate<String, Object> template = new RedisTemplate<>();
template.setConnectionFactory(jedisConnectionFactory());
template.setValueSerializer(new GenericToStringSerializer<Object>(Object.class));
return template;
}
}
dependency tree:
[INFO] com.javasampleapproach:spring-data-redis:jar:1.0
[INFO] +- org.springframework.boot:spring-boot-starter-actuator:jar:2.0.3.RELEASE:compile
[INFO] | +- org.springframework.boot:spring-boot-starter:jar:2.0.3.RELEASE:compile
[INFO] | | +- org.springframework.boot:spring-boot:jar:2.0.3.RELEASE:compile
[INFO] | | +- org.springframework.boot:spring-boot-autoconfigure:jar:2.0.3.RELEASE:compile
[INFO] | | +- org.springframework.boot:spring-boot-starter-logging:jar:2.0.3.RELEASE:compile
[INFO] | | | +- ch.qos.logback:logback-classic:jar:1.2.3:compile
[INFO] | | | | \- ch.qos.logback:logback-core:jar:1.2.3:compile
[INFO] | | | +- org.apache.logging.log4j:log4j-to-slf4j:jar:2.10.0:compile
[INFO] | | | | \- org.apache.logging.log4j:log4j-api:jar:2.10.0:compile
[INFO] | | | \- org.slf4j:jul-to-slf4j:jar:1.7.25:compile
[INFO] | | +- javax.annotation:javax.annotation-api:jar:1.3.2:compile
[INFO] | | \- org.yaml:snakeyaml:jar:1.19:runtime
[INFO] | +- org.springframework.boot:spring-boot-actuator-autoconfigure:jar:2.0.3.RELEASE:compile
[INFO] | | +- org.springframework.boot:spring-boot-actuator:jar:2.0.3.RELEASE:compile
[INFO] | | +- com.fasterxml.jackson.core:jackson-databind:jar:2.9.6:compile
[INFO] | | | +- com.fasterxml.jackson.core:jackson-annotations:jar:2.9.0:compile
[INFO] | | | \- com.fasterxml.jackson.core:jackson-core:jar:2.9.6:compile
[INFO] | | +- org.springframework:spring-context:jar:5.0.7.RELEASE:compile
[INFO] | | \- com.fasterxml.jackson.datatype:jackson-datatype-jsr310:jar:2.9.6:compile
[INFO] | \- io.micrometer:micrometer-core:jar:1.0.5:compile
[INFO] | +- org.hdrhistogram:HdrHistogram:jar:2.1.10:compile
[INFO] | \- org.latencyutils:LatencyUtils:jar:2.0.3:compile
[INFO] +- org.springframework.boot:spring-boot-starter-data-redis:jar:2.0.3.RELEASE:compile
[INFO] | +- org.springframework.data:spring-data-redis:jar:2.0.8.RELEASE:compile
[INFO] | | +- org.springframework.data:spring-data-keyvalue:jar:2.0.8.RELEASE:compile
[INFO] | | | \- org.springframework.data:spring-data-commons:jar:2.0.8.RELEASE:compile
[INFO] | | +- org.springframework:spring-tx:jar:5.0.7.RELEASE:compile
[INFO] | | +- org.springframework:spring-oxm:jar:5.0.7.RELEASE:compile
[INFO] | | +- org.springframework:spring-aop:jar:5.0.7.RELEASE:compile
[INFO] | | +- org.springframework:spring-context-support:jar:5.0.7.RELEASE:compile
[INFO] | | \- org.slf4j:slf4j-api:jar:1.7.25:compile
[INFO] | \- io.lettuce:lettuce-core:jar:5.0.4.RELEASE:compile
[INFO] | +- io.projectreactor:reactor-core:jar:3.1.8.RELEASE:compile
[INFO] | | \- org.reactivestreams:reactive-streams:jar:1.0.2:compile
[INFO] | +- io.netty:netty-common:jar:4.1.25.Final:compile
[INFO] | +- io.netty:netty-transport:jar:4.1.25.Final:compile
[INFO] | \- io.netty:netty-handler:jar:4.1.25.Final:compile
[INFO] +- org.springframework.boot:spring-boot-starter-web:jar:2.0.3.RELEASE:compile
[INFO] | +- org.springframework.boot:spring-boot-starter-json:jar:2.0.3.RELEASE:compile
[INFO] | | +- com.fasterxml.jackson.datatype:jackson-datatype-jdk8:jar:2.9.6:compile
[INFO] | | \- com.fasterxml.jackson.module:jackson-module-parameter-names:jar:2.9.6:compile
[INFO] | +- org.springframework.boot:spring-boot-starter-tomcat:jar:2.0.3.RELEASE:compile
[INFO] | | +- org.apache.tomcat.embed:tomcat-embed-core:jar:8.5.31:compile
[INFO] | | +- org.apache.tomcat.embed:tomcat-embed-el:jar:8.5.31:compile
[INFO] | | \- org.apache.tomcat.embed:tomcat-embed-websocket:jar:8.5.31:compile
[INFO] | +- org.hibernate.validator:hibernate-validator:jar:6.0.10.Final:compile
[INFO] | +- org.springframework:spring-web:jar:5.0.7.RELEASE:compile
[INFO] | | \- org.springframework:spring-beans:jar:5.0.7.RELEASE:compile
[INFO] | \- org.springframework:spring-webmvc:jar:5.0.7.RELEASE:compile
[INFO] | \- org.springframework:spring-expression:jar:5.0.7.RELEASE:compile
[INFO] +- org.projectlombok:lombok:jar:1.16.22:compile (optional)
[INFO] \- org.springframework.boot:spring-boot-starter-test:jar:2.0.3.RELEASE:test
[INFO] +- org.springframework.boot:spring-boot-test:jar:2.0.3.RELEASE:test
[INFO] +- org.springframework.boot:spring-boot-test-autoconfigure:jar:2.0.3.RELEASE:test
[INFO] +- com.jayway.jsonpath:json-path:jar:2.4.0:test
[INFO] | \- net.minidev:json-smart:jar:2.3:test
[INFO] | \- net.minidev:accessors-smart:jar:1.2:test
[INFO] | \- org.ow2.asm:asm:jar:5.0.4:test
[INFO] +- junit:junit:jar:4.12:test
[INFO] +- org.assertj:assertj-core:jar:3.9.1:test
[INFO] +- org.mockito:mockito-core:jar:2.15.0:test
[INFO] | +- net.bytebuddy:byte-buddy:jar:1.7.11:test
[INFO] | +- net.bytebuddy:byte-buddy-agent:jar:1.7.11:test
[INFO] | \- org.objenesis:objenesis:jar:2.6:test
[INFO] +- org.hamcrest:hamcrest-core:jar:1.3:test
[INFO] +- org.hamcrest:hamcrest-library:jar:1.3:test
[INFO] +- org.skyscreamer:jsonassert:jar:1.5.0:test
[INFO] | \- com.vaadin.external.google:android-json:jar:0.0.20131108.vaadin1:test
[INFO] +- org.springframework:spring-core:jar:5.0.7.RELEASE:compile
[INFO] | \- org.springframework:spring-jcl:jar:5.0.7.RELEASE:compile
[INFO] +- org.springframework:spring-test:jar:5.0.7.RELEASE:test
[INFO] \- org.xmlunit:xmlunit-core:jar:2.5.1:test
Your example is referencing boot 1.5.X which uses Jedis, by default lettuce is used in Boot 2.0 if you want to use Jedis you need to manually add the dependency. Additionally you can see that Jedis isn't on your classpath and lettuce is.
<dependency>
<groupId>redis.clients</groupId>
<artifactId>jedis</artifactId>
</dependency>
You might need to specify the dependency version. Alternatively you could just configure what you are attempting via lettuce.

Bean Creation Exception with org.springframework.security.config.annotation.web.configuration.WebSecurityConfiguration

We have been using spring boot 1.4.7.RELEASE version with spring security 4.1.0.RELEASE Version very successfully, recently we wanted to upgrade the boot as well security versions to 1.5.9, and the one that comes bundled is 4.2.3, but we are facing this Exception while starting up the project, via the commandline as well as on tomcat. Any help on this would be appreciated.
I have already tried to search similar issues in stack overflow as well as Github Issues database without much success.
org.springframework.beans.factory.BeanCreationException: Error creating bean ?>with name 'springSecurityFilterChain' defined in >org.springframework.security.config.annotation.web.configuration.WebSecurityConfiguration: Bean instantiation via factory method failed; nested exception is >org.springframework.beans.BeanInstantiationException: Failed to instantiate [javax.servlet.Filter]: Factory method 's
pringSecurityFilterChain' threw exception; nested exception is java.lang.NoSuchMethodError: org.springframework.boot.autoconfigure.security.SpringBootWebSecurityConfiguration.getIgnored(Lorg/springfra
mework/boot/autoconfigure/security/SecurityProperties;)Ljava/util/List;
at org.springframework.beans.factory.support.ConstructorResolver.instantiateUsingFactoryMethod(ConstructorResolver.java:599) ~[spring-beans-4.3.13.RELEASE.jar:4.3.13.RELEASE]
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.instantiateUsingFactoryMethod(AbstractAutowireCapableBeanFactory.java:1173) ~[spring-beans-4.3.13.RELEASE.jar:4.3.13.RE
LEASE]
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBeanInstance(AbstractAutowireCapableBeanFactory.java:1067) ~[spring-beans-4.3.13.RELEASE.jar:4.3.13.RELEASE]
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:513) ~[spring-beans-4.3.13.RELEASE.jar:4.3.13.RELEASE]
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:483) ~[spring-beans-4.3.13.RELEASE.jar:4.3.13.RELEASE]
at org.springframework.beans.factory.support.AbstractBeanFactory$1.getObject(AbstractBeanFactory.java:306) ~[spring-beans-4.3.13.RELEASE.jar:4.3.13.RELEASE]
at org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton(DefaultSingletonBeanRegistry.java:230) ~[spring-beans-4.3.13.RELEASE.jar:4.3.13.RELEASE]
at org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:302) ~[spring-beans-4.3.13.RELEASE.jar:4.3.13.RELEASE]
at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:197) ~[spring-beans-4.3.13.RELEASE.jar:4.3.13.RELEASE]
at org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:296) ~[spring-beans-4.3.13.RELEASE.jar:4.3.13.RELEASE]
at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:197) ~[spring-beans-4.3.13.RELEASE.jar:4.3.13.RELEASE]
at org.springframework.beans.factory.support.DefaultListableBeanFactory.preInstantiateSingletons(DefaultListableBeanFactory.java:761) ~[spring-beans-4.3.13.RELEASE.jar:4.3.13.RELEASE]
at org.springframework.context.support.AbstractApplicationContext.finishBeanFactoryInitialization(AbstractApplicationContext.java:867) ~[spring-context-4.3.13.RELEASE.jar:4.3.13.RELEASE]
at org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:543) ~[spring-context-4.3.13.RELEASE.jar:4.3.13.RELEASE]
at org.springframework.boot.context.embedded.EmbeddedWebApplicationContext.refresh(EmbeddedWebApplicationContext.java:122) ~[spring-boot-1.5.9.RELEASE.jar:1.5.9.RELEASE]
at org.springframework.boot.SpringApplication.refresh(SpringApplication.java:693) [spring-boot-1.5.9.RELEASE.jar:1.5.9.RELEASE]
at org.springframework.boot.SpringApplication.refreshContext(SpringApplication.java:360) [spring-boot-1.5.9.RELEASE.jar:1.5.9.RELEASE]
at org.springframework.boot.SpringApplication.run(SpringApplication.java:303) [spring-boot-1.5.9.RELEASE.jar:1.5.9.RELEASE]
at org.springframework.boot.SpringApplication.run(SpringApplication.java:1118) [spring-boot-1.5.9.RELEASE.jar:1.5.9.RELEASE]
at org.springframework.boot.SpringApplication.run(SpringApplication.java:1107) [spring-boot-1.5.9.RELEASE.jar:1.5.9.RELEASE]
at com.AuthApplication.main(AuthApplication.java:29) [classes/:na]
Caused by: org.springframework.beans.BeanInstantiationException: Failed to instantiate [javax.servlet.Filter]: Factory method 'springSecurityFilterChain' threw exception; nested exception is java.lang
.NoSuchMethodError: org.springframework.boot.autoconfigure.security.SpringBootWebSecurityConfiguration.getIgnored(Lorg/springframework/boot/autoconfigure/security/SecurityProperties;)Ljava/util/List;
at org.springframework.beans.factory.support.SimpleInstantiationStrategy.instantiate(SimpleInstantiationStrategy.java:189) ~[spring-beans-4.3.13.RELEASE.jar:4.3.13.RELEASE]
at org.springframework.beans.factory.support.ConstructorResolver.instantiateUsingFactoryMethod(ConstructorResolver.java:588) ~[spring-beans-4.3.13.RELEASE.jar:4.3.13.RELEASE]
... 20 common frames omitted
Caused by: java.lang.NoSuchMethodError: org.springframework.boot.autoconfigure.security.SpringBootWebSecurityConfiguration.getIgnored(Lorg/springframework/boot/autoconfigure/security/SecurityPropertie
s;)Ljava/util/List;
at org.springframework.boot.actuate.autoconfigure.ManagementWebSecurityAutoConfiguration$IgnoredPathsWebSecurityConfigurerAdapter.init(ManagementWebSecurityAutoConfiguration.java:160) ~[spring-boot-a
ctuator-1.3.3.RELEASE.jar:1.3.3.RELEASE]
at org.springframework.boot.actuate.autoconfigure.ManagementWebSecurityAutoConfiguration$IgnoredPathsWebSecurityConfigurerAdapter.init(ManagementWebSecurityAutoConfiguration.java:128) ~[spring-boot-a
ctuator-1.3.3.RELEASE.jar:1.3.3.RELEASE]
at org.springframework.security.config.annotation.AbstractConfiguredSecurityBuilder.init(AbstractConfiguredSecurityBuilder.java:371) ~[spring-security-config-4.2.3.RELEASE.jar:4.2.3.RELEASE]
at org.springframework.security.config.annotation.AbstractConfiguredSecurityBuilder.doBuild(AbstractConfiguredSecurityBuilder.java:325) ~[spring-security-config-4.2.3.RELEASE.jar:4.2.3.RELEASE]
at org.springframework.security.config.annotation.AbstractSecurityBuilder.build(AbstractSecurityBuilder.java:41) ~[spring-security-config-4.2.3.RELEASE.jar:4.2.3.RELEASE]
at org.springframework.security.config.annotation.web.configuration.WebSecurityConfiguration.springSecurityFilterChain(WebSecurityConfiguration.java:104) ~[spring-security-config-4.2.3.RELEASE.jar:4.
2.3.RELEASE]
at org.springframework.security.config.annotation.web.configuration.WebSecurityConfiguration$$EnhancerBySpringCGLIB$$26dd16a8.CGLIB$springSecurityFilterChain$4() ~[spring-security-config-4
.2.3.RELEASE.jar:4.2.3.RELEASE]
at org.springframework.security.config.annotation.web.configuration.WebSecurityConfiguration$$EnhancerBySpringCGLIB$$26dd16a8$$FastClassBySpringCGLIB$$f16ff4cb.invoke() ~[spring-security-c
onfig-4.2.3.RELEASE.jar:4.2.3.RELEASE]
at org.springframework.cglib.proxy.MethodProxy.invokeSuper(MethodProxy.java:228) ~[spring-core-4.3.13.RELEASE.jar:4.3.13.RELEASE]
at org.springframework.context.annotation.ConfigurationClassEnhancer$BeanMethodInterceptor.intercept(ConfigurationClassEnhancer.java:358) ~[spring-context-4.3.13.RELEASE.jar:4.3.13.RELEASE]
at org.springframework.security.config.annotation.web.configuration.WebSecurityConfiguration$$EnhancerBySpringCGLIB$$26dd16a8.springSecurityFilterChain() ~[spring-security-config-4.2.3.REL
EASE.jar:4.2.3.RELEASE]
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) ~[na:1.8.0_102]
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62) ~[na:1.8.0_102]
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) ~[na:1.8.0_102]
at java.lang.reflect.Method.invoke(Method.java:498) ~[na:1.8.0_102]
at org.springframework.beans.factory.support.SimpleInstantiationStrategy.instantiate(SimpleInstantiationStrategy.java:162) ~[spring-beans-4.3.13.RELEASE.jar:4.3.13.RELEASE]
... 21 common frames omitted
[INFO] +- org.owasp.encoder:encoder:jar:1.1.1:compile
[INFO] +- com.fasterxml.jackson.core:jackson-databind:jar:2.8.10:compile
[INFO] | +- com.fasterxml.jackson.core:jackson-annotations:jar:2.8.0:compile
[INFO] | \- com.fasterxml.jackson.core:jackson-core:jar:2.8.10:compile
[INFO] +- org.apache.commons:commons-lang3:jar:3.2.1:compile
[INFO] +- org.springframework.boot:spring-boot-starter-thymeleaf:jar:1.5.9.RELEASE:compile
[INFO] | +- org.springframework.boot:spring-boot-starter:jar:1.5.9.RELEASE:compile
[INFO] | | +- org.springframework.boot:spring-boot-starter-logging:jar:1.5.9.RELEASE:compile
[INFO] | | | +- ch.qos.logback:logback-classic:jar:1.1.11:compile
[INFO] | | | | \- ch.qos.logback:logback-core:jar:1.1.11:compile
[INFO] | | | +- org.slf4j:jul-to-slf4j:jar:1.7.25:compile
[INFO] | | | \- org.slf4j:log4j-over-slf4j:jar:1.7.25:compile
[INFO] | | \- org.yaml:snakeyaml:jar:1.17:runtime
[INFO] | +- org.thymeleaf:thymeleaf-spring4:jar:2.1.6.RELEASE:compile
[INFO] | \- nz.net.ultraq.thymeleaf:thymeleaf-layout-dialect:jar:1.4.0:compile
[INFO] | \- org.codehaus.groovy:groovy:jar:2.4.13:compile
[INFO] +- org.springframework.boot:spring-boot-starter-security:jar:1.5.9.RELEASE:compile
[INFO] | +- org.springframework:spring-aop:jar:4.3.13.RELEASE:compile
[INFO] | \- org.springframework.security:spring-security-config:jar:4.2.3.RELEASE:compile
[INFO] +- org.springframework.boot:spring-boot-starter-web:jar:1.5.9.RELEASE:compile
[INFO] | +- org.hibernate:hibernate-validator:jar:5.3.6.Final:compile
[INFO] | | +- javax.validation:validation-api:jar:1.1.0.Final:compile
[INFO] | | +- org.jboss.logging:jboss-logging:jar:3.3.1.Final:compile
[INFO] | | \- com.fasterxml:classmate:jar:1.3.4:compile
[INFO] | +- org.springframework:spring-web:jar:4.3.13.RELEASE:compile
[INFO] | \- org.springframework:spring-webmvc:jar:4.3.13.RELEASE:compile
[INFO] +- org.springframework.boot:spring-boot-starter-tomcat:jar:1.5.9.RELEASE:compile
[INFO] | +- org.apache.tomcat.embed:tomcat-embed-core:jar:8.5.23:compile
[INFO] | | \- org.apache.tomcat:tomcat-annotations-api:jar:8.5.23:compile
[INFO] | +- org.apache.tomcat.embed:tomcat-embed-el:jar:8.5.23:compile
[INFO] | \- org.apache.tomcat.embed:tomcat-embed-websocket:jar:8.5.23:compile
[INFO] +- org.springframework.boot:spring-boot-starter-test:jar:1.5.9.RELEASE:test
[INFO] | +- org.springframework.boot:spring-boot-test:jar:1.5.9.RELEASE:test
[INFO] | +- org.springframework.boot:spring-boot-test-autoconfigure:jar:1.5.9.RELEASE:test
[INFO] | +- com.jayway.jsonpath:json-path:jar:2.2.0:test
[INFO] | | \- net.minidev:json-smart:jar:2.2.1:test
[INFO] | | \- net.minidev:accessors-smart:jar:1.1:test
[INFO] | | \- org.ow2.asm:asm:jar:5.0.3:test
[INFO] | +- org.assertj:assertj-core:jar:2.6.0:test
[INFO] | +- org.mockito:mockito-core:jar:1.10.19:test
[INFO] | | \- org.objenesis:objenesis:jar:2.1:test
[INFO] | +- org.hamcrest:hamcrest-core:jar:1.3:test
[INFO] | +- org.hamcrest:hamcrest-library:jar:1.3:test
[INFO] | +- org.skyscreamer:jsonassert:jar:1.4.0:test
[INFO] | | \- com.vaadin.external.google:android-json:jar:0.0.20131108.vaadin1:test
[INFO] | +- org.springframework:spring-core:jar:4.3.13.RELEASE:compile
[INFO] | \- org.springframework:spring-test:jar:4.3.13.RELEASE:test
[INFO] +- org.springframework.boot:spring-boot-starter-web-services:jar:1.5.9.RELEASE:compile
[INFO] | +- org.springframework:spring-oxm:jar:4.3.13.RELEASE:compile
[INFO] | \- org.springframework.ws:spring-ws-core:jar:2.4.2.RELEASE:compile
[INFO] | \- org.springframework.ws:spring-xml:jar:2.4.2.RELEASE:compile
[INFO] +- org.springframework.security:spring-security-core:jar:4.2.3.RELEASE:compile
[INFO] | +- aopalliance:aopalliance:jar:1.0:compile
[INFO] | +- org.springframework:spring-beans:jar:4.3.13.RELEASE:compile
[INFO] | +- org.springframework:spring-context:jar:4.3.13.RELEASE:compile
[INFO] | \- org.springframework:spring-expression:jar:4.3.13.RELEASE:compile
[INFO] +- org.springframework.security:spring-security-web:jar:4.2.3.RELEASE:compile
[INFO] +- org.springframework.security:spring-security-test:jar:4.2.3.RELEASE:test
[INFO] +- org.springframework.security:spring-security-taglibs:jar:4.2.3.RELEASE:compile
[INFO] | \- org.springframework.security:spring-security-acl:jar:4.2.3.RELEASE:compile
[INFO] | \- org.springframework:spring-jdbc:jar:4.3.13.RELEASE:compile
[INFO] +- org.springframework.data:spring-data-redis:jar:1.8.9.RELEASE:compile
[INFO] | +- org.springframework.data:spring-data-keyvalue:jar:1.2.9.RELEASE:compile
[INFO] | | \- org.springframework.data:spring-data-commons:jar:1.13.9.RELEASE:compile
[INFO] | +- org.springframework:spring-tx:jar:4.3.13.RELEASE:compile
[INFO] | +- org.slf4j:slf4j-api:jar:1.7.25:compile
[INFO] | \- org.slf4j:jcl-over-slf4j:jar:1.7.25:compile
[INFO] +- com.rabbitmq:amqp-client:jar:3.4.4:compile
[INFO] +- org.zeromq:jeromq:jar:0.3.5:compile
[INFO] +- commons-cli:commons-cli:jar:1.1:compile
[INFO] +- commons-codec:commons-codec:jar:1.9:compile
[INFO] +- commons-io:commons-io:jar:1.2:compile
[INFO] +- com.omne:omnesys:jar:1.18.0.0:compile
[INFO] +- org.apache.logging.log4j:log4j-api:jar:2.7:compile
[INFO] +- org.apache.logging.log4j:log4j-core:jar:2.7:compile
[INFO] +- org.apache.logging.log4j:log4j-1.2-api:jar:2.3:compile
[INFO] +- com.lmax:disruptor:jar:3.3.0:compile
[INFO] +- commons-configuration:commons-configuration:jar:1.10:compile
[INFO] | +- commons-lang:commons-lang:jar:2.6:compile
[INFO] | \- commons-logging:commons-logging:jar:1.1.1:compile
[INFO] +- commons-collections:commons-collections:jar:3.2.2:compile
[INFO] +- junit:junit:jar:4.12:test
[INFO] +- net.sourceforge.nekohtml:nekohtml:jar:1.9.15:compile
[INFO] | \- xerces:xercesImpl:jar:2.9.1:compile
[INFO] +- bsf:bsf:jar:2.4.0:compile
[INFO] +- org.thymeleaf.extras:thymeleaf-extras-springsecurity3:jar:2.1.2.RELEASE:compile
[INFO] | \- org.thymeleaf:thymeleaf:jar:2.1.6.RELEASE:compile
[INFO] | +- ognl:ognl:jar:3.0.8:compile
[INFO] | +- org.javassist:javassist:jar:3.21.0-GA:compile
[INFO] | \- org.unbescape:unbescape:jar:1.1.0.RELEASE:compile
[INFO] +- net.sf.ehcache:ehcache:jar:2.9.0:compile
[INFO] +- com.googlecode.json-simple:json-simple:jar:1.1.1:compile
[INFO] +- org.springframework:spring-context-support:jar:4.1.7.RELEASE:compile
[INFO] +- org.json:json:jar:20151123:compile
[INFO] +- org.bouncycastle:bcprov-jdk15on:jar:1.52:compile
[INFO] +- org.bouncycastle:bcpkix-jdk15on:jar:1.52:compile
[INFO] +- xalan:xalan:jar:2.7.1:compile
[INFO] | \- xalan:serializer:jar:2.7.1:compile
[INFO] | \- xml-apis:xml-apis:jar:1.4.01:compile
[INFO] +- org.springframework.boot:spring-boot-starter-integration:jar:1.5.9.RELEASE:compile
[INFO] | +- org.springframework.boot:spring-boot-starter-aop:jar:1.5.9.RELEASE:compile
[INFO] | | \- org.aspectj:aspectjweaver:jar:1.8.9:compile
[INFO] | +- org.springframework.integration:spring-integration-core:jar:4.3.12.RELEASE:compile
[INFO] | | \- org.springframework.retry:spring-retry:jar:1.2.1.RELEASE:compile
[INFO] | \- org.springframework.integration:spring-integration-java-dsl:jar:1.2.3.RELEASE:compile
[INFO] | \- org.reactivestreams:reactive-streams:jar:1.0.0:compile
[INFO] +- com.google.code.gson:gson:jar:2.8.2:compile
[INFO] +- com.google.inject:guice:jar:2.0:compile
[INFO] +- org.springframework.boot:spring-boot-starter-websocket:jar:1.5.9.RELEASE:compile
[INFO] | +- org.springframework:spring-messaging:jar:4.3.13.RELEASE:compile
[INFO] | \- org.springframework:spring-websocket:jar:4.3.13.RELEASE:compile
[INFO] +- org.springframework.boot:spring-boot-starter-freemarker:jar:1.5.9.RELEASE:compile
[INFO] | \- org.freemarker:freemarker:jar:2.3.27-incubating:compile
[INFO] +- ant-contrib:ant-contrib:jar:1.0b3:compile
[INFO] +- org.apache.ant:ant-nodeps:jar:1.8.1:compile
[INFO] | \- org.apache.ant:ant:jar:1.8.1:compile
[INFO] | \- org.apache.ant:ant-launcher:jar:1.8.1:compile
[INFO] +- ant:ant-commons-net:jar:1.6.5:compile
[INFO] +- commons-net:commons-net:jar:1.4.1:compile
[INFO] | \- oro:oro:jar:2.0.8:compile
[INFO] +- org.springframework.boot:spring-boot-actuator:jar:1.3.3.RELEASE:compile
[INFO] | +- org.springframework.boot:spring-boot:jar:1.5.9.RELEASE:compile
[INFO] | \- org.springframework.boot:spring-boot-autoconfigure:jar:1.5.9.RELEASE:compile
[INFO] +- com.sun.jersey:jersey-client:jar:1.19.3:compile
[INFO] | \- com.sun.jersey:jersey-core:jar:1.19.3:compile
[INFO] | \- javax.ws.rs:jsr311-api:jar:1.1.1:compile
[INFO] +- org.apache.httpcomponents:httpclient:jar:4.3.6:compile
[INFO] | \- org.apache.httpcomponents:httpcore:jar:4.4.8:compile
[INFO] +- org.codehaus.jackson:jackson-mapper-asl:jar:1.9.13:compile
[INFO] | \- org.codehaus.jackson:jackson-core-asl:jar:1.9.13:compile
[INFO] +- org.springframework.session:spring-session:jar:1.3.1.RELEASE:compile
[INFO] +- org.apache.commons:commons-pool2:jar:2.4.2:compile
[INFO] \- redis.clients:jedis:jar:2.9.0:compile
It's due to this dependency: org.springframework.boot:spring-boot-actuator:jar:1.3.3.RELE‌​ASE. The ManagementWebSecurityAutoConfiguration class use an older version of SpringBootWebSecurityConfiguration, calling the static method getIgnored that doesn't exist in org.springframework.boot:spring-boot-autoconfigure:jar:1.5.9‌​.RELEASE. Updating this dependency to org.springframework.boot:spring-boot-actuator:jar:1.5.9.RELE‌​‌​ASE should solve your problem

Service don't start after upgrading to Spring boot 1.4

I just upgraded all my spring boot services from 1.3.6.RELEASE to 1.4.0.RELEASE. Now all of them crash at startup with a :
Caused by: java.lang.NoClassDefFoundError: org/springframework/beans/factory/ObjectProvider
at java.lang.Class.getDeclaredConstructors0(Native Method) ~[na:1.8.0_91]
at java.lang.Class.privateGetDeclaredConstructors(Class.java:2671) ~[na:1.8.0_91]
at java.lang.Class.getDeclaredConstructors(Class.java:2020) ~[na:1.8.0_91]
at org.springframework.cglib.proxy.Enhancer.generateClass(Enhancer.java:566) ~[spring-core-4.3.2.RELEASE.jar:4.3.2.RELEASE]
Here is one of my service dependency tree:
[INFO] com.onedesk:history-service:jar:0.0.1-SNAPSHOT
[INFO] +- com.onedesk.shared:dto:jar:1.0-SNAPSHOT:compile
[INFO] | \- com.onedesk.shared:core:jar:1.0-SNAPSHOT:compile
[INFO] +- com.onedesk.shared:endpoints:jar:1.0-SNAPSHOT:compile
[INFO] | +- (com.onedesk.shared:dto:jar:1.0-SNAPSHOT:compile - omitted for duplicate)
[INFO] | +- org.springframework:spring-context:jar:4.2.6.RELEASE:compile (version managed from 4.2.7.RELEASE)
[INFO] | | +- org.springframework:spring-aop:jar:4.2.6.RELEASE:compile
[INFO] | | | +- aopalliance:aopalliance:jar:1.0:compile
[INFO] | | | +- (org.springframework:spring-beans:jar:4.2.6.RELEASE:compile - omitted for duplicate)
[INFO] | | | \- (org.springframework:spring-core:jar:4.3.2.RELEASE:compile - version managed from 4.2.6.RELEASE; omitted for duplicate)
[INFO] | | +- org.springframework:spring-beans:jar:4.2.6.RELEASE:compile
[INFO] | | | \- (org.springframework:spring-core:jar:4.3.2.RELEASE:compile - version managed from 4.2.6.RELEASE; omitted for duplicate)
[INFO] | | +- (org.springframework:spring-core:jar:4.3.2.RELEASE:compile - version managed from 4.2.6.RELEASE; omitted for duplicate)
[INFO] | | \- org.springframework:spring-expression:jar:4.2.6.RELEASE:compile
[INFO] | | \- (org.springframework:spring-core:jar:4.3.2.RELEASE:compile - version managed from 4.2.6.RELEASE; omitted for duplicate)
[INFO] | +- org.springframework:spring-web:jar:4.2.6.RELEASE:compile (version managed from 4.2.7.RELEASE)
[INFO] | | +- (org.springframework:spring-aop:jar:4.2.6.RELEASE:compile - omitted for duplicate)
[INFO] | | +- (org.springframework:spring-beans:jar:4.2.6.RELEASE:compile - omitted for duplicate)
[INFO] | | +- (org.springframework:spring-context:jar:4.2.6.RELEASE:compile - version managed from 4.2.7.RELEASE; omitted for duplicate)
[INFO] | | \- (org.springframework:spring-core:jar:4.3.2.RELEASE:compile - version managed from 4.2.6.RELEASE; omitted for duplicate)
[INFO] | \- log4j:log4j:jar:1.2.17:compile
[INFO] +- org.springframework.boot:spring-boot-starter-actuator:jar:1.4.0.RELEASE:compile
[INFO] | +- org.springframework.boot:spring-boot-starter:jar:1.4.0.RELEASE:compile
[INFO] | | +- org.springframework.boot:spring-boot:jar:1.4.0.RELEASE:compile
[INFO] | | | +- (org.springframework:spring-core:jar:4.3.2.RELEASE:compile - version managed from 4.2.6.RELEASE; omitted for duplicate)
[INFO] | | | \- (org.springframework:spring-context:jar:4.2.6.RELEASE:compile - version managed from 4.3.2.RELEASE; omitted for duplicate)
[INFO] | | +- org.springframework.boot:spring-boot-autoconfigure:jar:1.4.0.RELEASE:compile
[INFO] | | | \- (org.springframework.boot:spring-boot:jar:1.4.0.RELEASE:compile - omitted for duplicate)
[INFO] | | +- org.springframework.boot:spring-boot-starter-logging:jar:1.4.0.RELEASE:compile
[INFO] | | | +- ch.qos.logback:logback-classic:jar:1.1.7:compile
[INFO] | | | | +- ch.qos.logback:logback-core:jar:1.1.7:compile
[INFO] | | | | \- (org.slf4j:slf4j-api:jar:1.7.21:compile - version managed from 1.6.6; omitted for duplicate)
[INFO] | | | +- org.slf4j:jcl-over-slf4j:jar:1.7.21:compile
[INFO] | | | | \- (org.slf4j:slf4j-api:jar:1.7.21:compile - version managed from 1.7.20; omitted for duplicate)
[INFO] | | | +- org.slf4j:jul-to-slf4j:jar:1.7.21:compile
[INFO] | | | | \- (org.slf4j:slf4j-api:jar:1.7.21:compile - version managed from 1.7.20; omitted for duplicate)
[INFO] | | | \- org.slf4j:log4j-over-slf4j:jar:1.7.21:compile
[INFO] | | | \- (org.slf4j:slf4j-api:jar:1.7.21:compile - version managed from 1.7.20; omitted for duplicate)
[INFO] | | +- (org.springframework:spring-core:jar:4.3.2.RELEASE:compile - version managed from 4.2.6.RELEASE; omitted for duplicate)
[INFO] | | \- org.yaml:snakeyaml:jar:1.17:runtime
[INFO] | \- org.springframework.boot:spring-boot-actuator:jar:1.4.0.RELEASE:compile
[INFO] | +- (org.springframework.boot:spring-boot:jar:1.4.0.RELEASE:compile - omitted for duplicate)
[INFO] | +- (org.springframework.boot:spring-boot-autoconfigure:jar:1.4.0.RELEASE:compile - omitted for duplicate)
[INFO] | +- (com.fasterxml.jackson.core:jackson-databind:jar:2.8.1:compile - omitted for duplicate)
[INFO] | +- (org.springframework:spring-core:jar:4.3.2.RELEASE:compile - version managed from 4.2.6.RELEASE; omitted for duplicate)
[INFO] | \- (org.springframework:spring-context:jar:4.2.6.RELEASE:compile - version managed from 4.3.2.RELEASE; omitted for duplicate)
[INFO] +- org.projectlombok:lombok:jar:1.16.10:compile
[INFO] +- org.springframework.boot:spring-boot-starter-remote-shell:jar:1.4.0.RELEASE:compile
[INFO] | +- (org.springframework.boot:spring-boot-starter:jar:1.4.0.RELEASE:compile - omitted for duplicate)
[INFO] | +- (org.springframework.boot:spring-boot-starter-actuator:jar:1.4.0.RELEASE:compile - omitted for duplicate)
[INFO] | +- org.crashub:crash.cli:jar:1.3.2:compile
[INFO] | +- org.crashub:crash.connectors.ssh:jar:1.3.2:compile
[INFO] | | +- (org.crashub:crash.shell:jar:1.3.2:compile - omitted for duplicate)
[INFO] | | +- org.apache.sshd:sshd-core:jar:0.11.0:compile
[INFO] | | | \- (org.apache.mina:mina-core:jar:2.0.7:compile - omitted for duplicate)
[INFO] | | +- org.apache.sshd:sshd-pam:jar:0.11.0:compile
[INFO] | | | +- (org.apache.sshd:sshd-core:jar:0.11.0:compile - omitted for duplicate)
[INFO] | | | \- net.sf.jpam:jpam:jar:1.1:compile
[INFO] | | +- org.bouncycastle:bcprov-jdk15on:jar:1.51:compile
[INFO] | | +- org.bouncycastle:bcpkix-jdk15on:jar:1.51:compile
[INFO] | | | \- (org.bouncycastle:bcprov-jdk15on:jar:1.51:compile - omitted for duplicate)
[INFO] | | \- org.apache.mina:mina-core:jar:2.0.7:compile
[INFO] | | \- org.slf4j:slf4j-api:jar:1.7.21:compile
[INFO] | +- org.crashub:crash.embed.spring:jar:1.3.2:compile
[INFO] | | +- (org.crashub:crash.shell:jar:1.3.2:compile - omitted for duplicate)
[INFO] | | +- (org.springframework:spring-core:jar:4.3.2.RELEASE:compile - version managed from 3.1.1.RELEASE; omitted for duplicate)
[INFO] | | +- (org.springframework:spring-context:jar:4.2.6.RELEASE:compile - version managed from 3.1.1.RELEASE; omitted for duplicate)
[INFO] | | \- (org.springframework:spring-beans:jar:4.2.6.RELEASE:compile - version managed from 3.1.1.RELEASE; omitted for duplicate)
[INFO] | +- org.crashub:crash.plugins.cron:jar:1.3.2:compile
[INFO] | | +- (org.crashub:crash.shell:jar:1.3.2:compile - omitted for duplicate)
[INFO] | | \- it.sauronsoftware.cron4j:cron4j:jar:2.2.5:compile
[INFO] | +- org.crashub:crash.plugins.mail:jar:1.3.2:compile
[INFO] | | \- (org.crashub:crash.shell:jar:1.3.2:compile - omitted for duplicate)
[INFO] | +- org.crashub:crash.shell:jar:1.3.2:compile
[INFO] | | \- (org.crashub:crash.cli:jar:1.3.2:compile - omitted for duplicate)
[INFO] | +- org.codehaus.groovy:groovy:jar:2.4.7:compile
[INFO] | \- com.sun.mail:javax.mail:jar:1.5.5:compile
[INFO] | \- javax.activation:activation:jar:1.1:compile
[INFO] +- org.springframework.boot:spring-boot-starter-web:jar:1.4.0.RELEASE:compile
[INFO] | +- (org.springframework.boot:spring-boot-starter:jar:1.4.0.RELEASE:compile - omitted for duplicate)
[INFO] | +- org.springframework.boot:spring-boot-starter-tomcat:jar:1.4.0.RELEASE:compile
[INFO] | | +- org.apache.tomcat.embed:tomcat-embed-core:jar:8.5.4:compile
[INFO] | | +- org.apache.tomcat.embed:tomcat-embed-el:jar:8.5.4:compile
[INFO] | | \- org.apache.tomcat.embed:tomcat-embed-websocket:jar:8.5.4:compile
[INFO] | | \- (org.apache.tomcat.embed:tomcat-embed-core:jar:8.5.4:compile - omitted for duplicate)
[INFO] | +- org.hibernate:hibernate-validator:jar:5.2.4.Final:compile
[INFO] | | +- javax.validation:validation-api:jar:1.1.0.Final:compile
[INFO] | | +- org.jboss.logging:jboss-logging:jar:3.3.0.Final:compile (version managed from 3.2.1.Final)
[INFO] | | \- com.fasterxml:classmate:jar:1.3.1:compile (version managed from 1.1.0)
[INFO] | +- com.fasterxml.jackson.core:jackson-databind:jar:2.8.1:compile
[INFO] | | +- com.fasterxml.jackson.core:jackson-annotations:jar:2.8.1:compile (version managed from 2.8.0)
[INFO] | | \- com.fasterxml.jackson.core:jackson-core:jar:2.8.1:compile
[INFO] | +- (org.springframework:spring-web:jar:4.2.6.RELEASE:compile - version managed from 4.3.2.RELEASE; omitted for duplicate)
[INFO] | \- org.springframework:spring-webmvc:jar:4.2.6.RELEASE:compile (version managed from 4.3.2.RELEASE)
[INFO] | +- (org.springframework:spring-beans:jar:4.2.6.RELEASE:compile - version managed from 3.1.1.RELEASE; omitted for duplicate)
[INFO] | +- (org.springframework:spring-context:jar:4.2.6.RELEASE:compile - version managed from 3.1.1.RELEASE; omitted for duplicate)
[INFO] | +- (org.springframework:spring-core:jar:4.3.2.RELEASE:compile - version managed from 4.2.6.RELEASE; omitted for duplicate)
[INFO] | +- (org.springframework:spring-expression:jar:4.2.6.RELEASE:compile - omitted for duplicate)
[INFO] | \- (org.springframework:spring-web:jar:4.2.6.RELEASE:compile - version managed from 4.3.2.RELEASE; omitted for duplicate)
[INFO] +- org.springframework.boot:spring-boot-starter-test:jar:1.4.0.RELEASE:test
[INFO] | +- org.springframework.boot:spring-boot-test:jar:1.4.0.RELEASE:test
[INFO] | | \- (org.springframework.boot:spring-boot:jar:1.4.0.RELEASE:test - omitted for duplicate)
[INFO] | +- org.springframework.boot:spring-boot-test-autoconfigure:jar:1.4.0.RELEASE:test
[INFO] | | +- (org.springframework.boot:spring-boot-test:jar:1.4.0.RELEASE:test - omitted for duplicate)
[INFO] | | \- (org.springframework.boot:spring-boot-autoconfigure:jar:1.4.0.RELEASE:test - omitted for duplicate)
[INFO] | +- com.jayway.jsonpath:json-path:jar:2.2.0:test
[INFO] | | +- net.minidev:json-smart:jar:2.2.1:test
[INFO] | | | \- net.minidev:accessors-smart:jar:1.1:test
[INFO] | | | \- (org.ow2.asm:asm:jar:5.0.3:test - omitted for conflict with 5.0.4)
[INFO] | | \- (org.slf4j:slf4j-api:jar:1.7.21:compile - version managed from 1.7.16; scope updated from test; omitted for duplicate)
[INFO] | +- junit:junit:jar:4.12:test
[INFO] | | \- (org.hamcrest:hamcrest-core:jar:1.3:test - version managed from 1.1; omitted for duplicate)
[INFO] | +- org.assertj:assertj-core:jar:2.5.0:test
[INFO] | +- org.mockito:mockito-core:jar:1.10.19:test
[INFO] | | +- (org.hamcrest:hamcrest-core:jar:1.3:test - version managed from 1.1; omitted for duplicate)
[INFO] | | \- org.objenesis:objenesis:jar:2.1:test
[INFO] | +- org.hamcrest:hamcrest-core:jar:1.3:test
[INFO] | +- org.hamcrest:hamcrest-library:jar:1.3:test
[INFO] | | \- (org.hamcrest:hamcrest-core:jar:1.3:test - version managed from 1.1; omitted for duplicate)
[INFO] | +- org.skyscreamer:jsonassert:jar:1.3.0:test
[INFO] | | \- (org.json:json:jar:20140107:test - version managed from 20090211; omitted for duplicate)
[INFO] | +- (org.springframework:spring-core:jar:4.3.2.RELEASE:compile - version managed from 4.2.6.RELEASE; scope updated from test; omitted for duplicate)
[INFO] | \- org.springframework:spring-test:jar:4.2.6.RELEASE:test (version managed from 4.3.2.RELEASE)
[INFO] | \- (org.springframework:spring-core:jar:4.3.2.RELEASE:test - version managed from 4.2.6.RELEASE; omitted for duplicate)
[INFO] +- org.springframework.boot:spring-boot-configuration-processor:jar:1.4.0.RELEASE:compile
[INFO] | +- org.json:json:jar:20140107:compile
[INFO] | \- org.springframework:spring-core:jar:4.3.2.RELEASE:compile
[INFO] \- org.springframework.cloud:spring-cloud-starter-eureka:jar:1.1.0.RELEASE:compile
[INFO] +- (org.springframework.boot:spring-boot-starter-web:jar:1.4.0.RELEASE:compile - version managed from 1.3.5.RELEASE; omitted for duplicate)
[INFO] +- org.springframework.cloud:spring-cloud-starter:jar:1.1.0.RELEASE:compile
[INFO] | +- (org.springframework.boot:spring-boot-starter:jar:1.4.0.RELEASE:compile - version managed from 1.3.4.RELEASE; omitted for duplicate)
[INFO] | +- org.springframework.cloud:spring-cloud-context:jar:1.1.0.RELEASE:compile
[INFO] | | \- org.springframework.security:spring-security-crypto:jar:4.0.4.RELEASE:compile
[INFO] | +- org.springframework.cloud:spring-cloud-commons:jar:1.1.0.RELEASE:compile
[INFO] | | \- (org.springframework.security:spring-security-crypto:jar:4.0.4.RELEASE:compile - omitted for duplicate)
[INFO] | \- org.springframework.security:spring-security-rsa:jar:1.0.1.RELEASE:compile
[INFO] | +- (org.springframework.security:spring-security-crypto:jar:4.0.4.RELEASE:compile - version managed from 3.2.7.RELEASE; omitted for duplicate)
[INFO] | +- (org.springframework:spring-core:jar:4.3.2.RELEASE:compile - version managed from 4.1.6.RELEASE; omitted for duplicate)
[INFO] | \- (org.bouncycastle:bcpkix-jdk15on:jar:1.47:compile - omitted for conflict with 1.51)
[INFO] +- org.springframework.cloud:spring-cloud-netflix-core:jar:1.1.0.RELEASE:compile
[INFO] | +- (org.springframework.boot:spring-boot:jar:1.4.0.RELEASE:compile - version managed from 1.3.5.RELEASE; omitted for duplicate)
[INFO] | \- (org.springframework.boot:spring-boot-autoconfigure:jar:1.4.0.RELEASE:compile - version managed from 1.3.5.RELEASE; omitted for duplicate)
[INFO] +- org.springframework.cloud:spring-cloud-netflix-eureka-client:jar:1.1.0.RELEASE:compile
[INFO] | \- (org.springframework.cloud:spring-cloud-netflix-core:jar:1.1.0.RELEASE:compile - omitted for duplicate)
[INFO] +- com.netflix.eureka:eureka-client:jar:1.4.6:compile
[INFO] | +- org.codehaus.jettison:jettison:jar:1.3.7:runtime
[INFO] | | \- stax:stax-api:jar:1.0.1:runtime
[INFO] | +- com.netflix.netflix-commons:netflix-eventbus:jar:0.3.0:runtime
[INFO] | | +- (org.slf4j:slf4j-api:jar:1.7.21:runtime - version managed from 1.6.4; omitted for duplicate)
[INFO] | | +- (com.netflix.servo:servo-core:jar:0.10.1:runtime - version managed from 0.5.3; omitted for duplicate)
[INFO] | | \- (com.netflix.archaius:archaius-core:jar:0.7.4:runtime - version managed from 0.7.3; omitted for duplicate)
[INFO] | +- (com.thoughtworks.xstream:xstream:jar:1.4.2:runtime - omitted for duplicate)
[INFO] | +- (com.netflix.archaius:archaius-core:jar:0.7.4:compile - version managed from 0.7.3; scope updated from runtime; omitted for duplicate)
[INFO] | +- javax.ws.rs:jsr311-api:jar:1.1.1:runtime
[INFO] | +- com.netflix.servo:servo-core:jar:0.10.1:runtime
[INFO] | | +- (org.slf4j:slf4j-api:jar:1.7.21:runtime - version managed from 1.7.12; omitted for duplicate)
[INFO] | | +- (com.google.guava:guava:jar:18.0:runtime - version managed from 16.0.1; omitted for duplicate)
[INFO] | | \- com.netflix.servo:servo-internal:jar:0.10.1:runtime
[INFO] | | +- (org.slf4j:slf4j-api:jar:1.7.21:runtime - version managed from 1.7.12; omitted for duplicate)
[INFO] | | \- (com.google.guava:guava:jar:18.0:runtime - version managed from 16.0.1; omitted for duplicate)
[INFO] | +- com.sun.jersey:jersey-core:jar:1.19.1:runtime (version managed from 1.19)
[INFO] | | \- (javax.ws.rs:jsr311-api:jar:1.1.1:runtime - omitted for duplicate)
[INFO] | +- com.sun.jersey:jersey-client:jar:1.19.1:runtime (version managed from 1.19)
[INFO] | | \- (com.sun.jersey:jersey-core:jar:1.19.1:runtime - version managed from 1.19; omitted for duplicate)
[INFO] | +- com.sun.jersey.contribs:jersey-apache-client4:jar:1.19.1:runtime (version managed from 1.19)
[INFO] | | +- (org.apache.httpcomponents:httpclient:jar:4.5.2:runtime - version managed from 4.3.4; omitted for duplicate)
[INFO] | | \- (com.sun.jersey:jersey-client:jar:1.19.1:runtime - version managed from 1.19; omitted for duplicate)
[INFO] | +- org.apache.httpcomponents:httpclient:jar:4.5.2:runtime
[INFO] | | +- org.apache.httpcomponents:httpcore:jar:4.4.5:runtime (version managed from 4.4.4)
[INFO] | | \- commons-codec:commons-codec:jar:1.10:runtime (version managed from 1.9)
[INFO] | +- com.google.inject:guice:jar:4.0:runtime
[INFO] | | +- javax.inject:javax.inject:jar:1:runtime
[INFO] | | +- (aopalliance:aopalliance:jar:1.0:runtime - omitted for duplicate)
[INFO] | | \- (com.google.guava:guava:jar:18.0:runtime - version managed from 16.0.1; omitted for duplicate)
[INFO] | +- com.netflix.governator:governator-api:jar:1.12.10:runtime
[INFO] | | \- (javax.inject:javax.inject:jar:1:runtime - omitted for duplicate)
[INFO] | +- (com.fasterxml.jackson.core:jackson-annotations:jar:2.8.1:runtime - version managed from 2.5.4; omitted for duplicate)
[INFO] | +- (com.fasterxml.jackson.core:jackson-core:jar:2.8.1:runtime - version managed from 2.5.4; omitted for duplicate)
[INFO] | \- (com.fasterxml.jackson.core:jackson-databind:jar:2.8.1:runtime - version managed from 2.5.4; omitted for duplicate)
[INFO] +- com.netflix.eureka:eureka-core:jar:1.4.6:compile
[INFO] | +- (com.netflix.eureka:eureka-client:jar:1.4.6:runtime - omitted for duplicate)
[INFO] | +- com.amazonaws:aws-java-sdk-core:jar:1.10.30:runtime (version managed from 1.9.3)
[INFO] | | +- (org.apache.httpcomponents:httpclient:jar:4.5.2:runtime - version managed from 4.3.6; omitted for duplicate)
[INFO] | | \- (com.fasterxml.jackson.core:jackson-databind:jar:2.8.1:runtime - version managed from 2.5.3; omitted for duplicate)
[INFO] | +- com.amazonaws:aws-java-sdk-ec2:jar:1.10.30:runtime (version managed from 1.9.3)
[INFO] | | \- (com.amazonaws:aws-java-sdk-core:jar:1.10.30:runtime - version managed from 1.9.3; omitted for duplicate)
[INFO] | +- com.amazonaws:aws-java-sdk-autoscaling:jar:1.9.3:runtime
[INFO] | | \- (com.amazonaws:aws-java-sdk-core:jar:1.10.30:runtime - version managed from 1.9.3; omitted for duplicate)
[INFO] | +- com.amazonaws:aws-java-sdk-sts:jar:1.9.3:runtime
[INFO] | | \- (com.amazonaws:aws-java-sdk-core:jar:1.10.30:runtime - version managed from 1.9.3; omitted for duplicate)
[INFO] | +- com.amazonaws:aws-java-sdk-route53:jar:1.9.3:runtime
[INFO] | | \- (com.amazonaws:aws-java-sdk-core:jar:1.10.30:runtime - version managed from 1.9.3; omitted for duplicate)
[INFO] | +- com.netflix.governator:governator:jar:1.12.10:runtime
[INFO] | | +- (com.netflix.governator:governator-api:jar:1.12.10:runtime - omitted for duplicate)
[INFO] | | +- com.netflix.governator:governator-core:jar:1.12.10:runtime
[INFO] | | | +- (com.netflix.governator:governator-api:jar:1.12.10:runtime - omitted for duplicate)
[INFO] | | | +- (javax.inject:javax.inject:jar:1:runtime - omitted for duplicate)
[INFO] | | | +- (org.slf4j:slf4j-api:jar:1.7.21:runtime - version managed from 1.6.3; omitted for duplicate)
[INFO] | | | \- (com.google.inject:guice:jar:4.0:runtime - omitted for duplicate)
[INFO] | | +- org.ow2.asm:asm:jar:5.0.4:runtime
[INFO] | | \- (com.fasterxml.jackson.core:jackson-databind:jar:2.8.1:runtime - version managed from 2.4.3; omitted for duplicate)
[INFO] | +- (com.thoughtworks.xstream:xstream:jar:1.4.2:runtime - omitted for duplicate)
[INFO] | +- (javax.ws.rs:jsr311-api:jar:1.1.1:runtime - omitted for duplicate)
[INFO] | \- org.codehaus.woodstox:woodstox-core-asl:jar:4.4.1:runtime
[INFO] | +- javax.xml.stream:stax-api:jar:1.0-2:runtime
[INFO] | \- org.codehaus.woodstox:stax2-api:jar:3.1.4:runtime
[INFO] +- org.springframework.cloud:spring-cloud-starter-archaius:jar:1.1.0.RELEASE:compile
[INFO] | +- (org.springframework.cloud:spring-cloud-starter:jar:1.1.0.RELEASE:compile - omitted for duplicate)
[INFO] | +- (org.springframework.cloud:spring-cloud-netflix-core:jar:1.1.0.RELEASE:compile - omitted for duplicate)
[INFO] | +- com.netflix.archaius:archaius-core:jar:0.7.4:compile
[INFO] | | +- com.google.code.findbugs:jsr305:jar:3.0.1:runtime
[INFO] | | +- (commons-configuration:commons-configuration:jar:1.8:runtime - omitted for duplicate)
[INFO] | | +- (org.slf4j:slf4j-api:jar:1.7.21:runtime - version managed from 1.6.4; omitted for duplicate)
[INFO] | | +- (com.google.guava:guava:jar:18.0:runtime - version managed from 16.0; omitted for duplicate)
[INFO] | | +- (com.fasterxml.jackson.core:jackson-annotations:jar:2.8.1:runtime - version managed from 2.4.3; omitted for duplicate)
[INFO] | | +- (com.fasterxml.jackson.core:jackson-core:jar:2.8.1:runtime - version managed from 2.4.3; omitted for duplicate)
[INFO] | | \- (com.fasterxml.jackson.core:jackson-databind:jar:2.8.1:runtime - version managed from 2.4.3; omitted for duplicate)
[INFO] | +- commons-configuration:commons-configuration:jar:1.8:compile
[INFO] | | +- commons-lang:commons-lang:jar:2.6:compile
[INFO] | | \- commons-logging:commons-logging:jar:1.1.1:compile
[INFO] | +- (com.fasterxml.jackson.core:jackson-annotations:jar:2.8.1:compile - version managed from 2.6.6; omitted for duplicate)
[INFO] | +- (com.fasterxml.jackson.core:jackson-core:jar:2.8.1:compile - version managed from 2.6.6; omitted for duplicate)
[INFO] | +- (com.fasterxml.jackson.core:jackson-databind:jar:2.8.1:compile - version managed from 2.6.6; omitted for duplicate)
[INFO] | \- com.google.guava:guava:jar:18.0:compile
It seems that there is a spring version issue there but I have not idea where it comes from. Here is my pom.xml.
<?xml version="1.0" encoding="UTF-8"?>
<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">
<modelVersion>4.0.0</modelVersion>
<groupId>com.onedesk</groupId>
<artifactId>history-service</artifactId>
<version>0.0.1-SNAPSHOT</version>
<packaging>jar</packaging>
<name>history-service</name>
<description>history service</description>
<parent>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-parent</artifactId>
<version>1.4.0.RELEASE</version>
<relativePath/> <!-- lookup parent from repository -->
</parent>
<properties>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
<java.version>1.8</java.version>
</properties>
<dependencies>
<dependency>
<groupId>com.onedesk.shared</groupId>
<artifactId>dto</artifactId>
<version>1.0-SNAPSHOT</version>
</dependency>
<dependency>
<groupId>com.onedesk.shared</groupId>
<artifactId>endpoints</artifactId>
<version>1.0-SNAPSHOT</version>
</dependency>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-actuator</artifactId>
</dependency>
<dependency>
<groupId>org.projectlombok</groupId>
<artifactId>lombok</artifactId>
</dependency>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-remote-shell</artifactId>
</dependency>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-web</artifactId>
</dependency>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-test</artifactId>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-configuration-processor</artifactId>
<optional>true</optional>
</dependency>
<dependency>
<groupId>org.springframework.cloud</groupId>
<artifactId>spring-cloud-starter-eureka</artifactId>
</dependency>
</dependencies>
<dependencyManagement>
<dependencies>
<dependency>
<groupId>org.springframework.cloud</groupId>
<artifactId>spring-cloud-starter-parent</artifactId>
<version>Brixton.RELEASE</version>
<type>pom</type>
<scope>import</scope>
</dependency>
</dependencies>
</dependencyManagement>
<build>
<plugins>
<plugin>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-maven-plugin</artifactId>
</plugin>
</plugins>
</build>
<repositories>
<repository>
<id>spring-snapshots</id>
<name>Spring Snapshots</name>
<url>https://repo.spring.io/snapshot</url>
<snapshots>
<enabled>true</enabled>
</snapshots>
</repository>
<repository>
<id>spring-milestones</id>
<name>Spring Milestones</name>
<url>https://repo.spring.io/milestone</url>
<snapshots>
<enabled>false</enabled>
</snapshots>
</repository>
</repositories>
</project>
So the issue was in dependencyManagement:
<dependencyManagement>
<dependencies>
<dependency>
<groupId>org.springframework.cloud</groupId>
<artifactId>spring-cloud-starter-parent</artifactId>
<version>Brixton.RELEASE</version>
<type>pom</type>
<scope>import</scope>
</dependency>
</dependencies>
</dependencyManagement>
I just needed to replace to:
<dependencyManagement>
<dependencies>
<dependency>
<groupId>org.springframework.cloud</groupId>
<artifactId>spring-cloud-dependencies</artifactId> <!--changed-->
<version>Brixton.SR4</version> <!--changed-->
<type>pom</type>
<scope>import</scope>
</dependency>
</dependencies>
</dependencyManagement>
You need to setup a dependencyManagement section in your pom.xml with Spring Boot's BOM dependency. Check it out here. But basically you need to add this:
<dependencyManagement>
<dependencies>
<dependency>
<!-- Import dependency management from Spring Boot -->
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-dependencies</artifactId>
<version>1.4.0.RELEASE</version>
<type>pom</type>
<scope>import</scope>
</dependency>
</dependencies>
</dependencyManagement>
After that drop the version in all your spring-related dependencies and the versions will be managed by the above dependency.
--- Edit ---
Based on your comments try modifying your dependencies:
<dependency>
<groupId>com.onedesk.shared</groupId>
<artifactId>dto</artifactId>
<version>1.0-SNAPSHOT</version>
</dependency>
<dependency>
<groupId>com.onedesk.shared</groupId>
<artifactId>endpoints</artifactId>
<version>1.0-SNAPSHOT</version>
</dependency>
to this:
<dependency>
<groupId>com.onedesk.shared</groupId>
<artifactId>dto</artifactId>
<version>1.0-SNAPSHOT</version>
<exclusions>
<exclusion>
<groupId>org.springframework</groupId>
<artifactId>*</artifactId>
</exclusion>
</exclusions>
</dependency>
<dependency>
<groupId>com.onedesk.shared</groupId>
<artifactId>endpoints</artifactId>
<version>1.0-SNAPSHOT</version>
<exclusions>
<exclusion>
<groupId>org.springframework</groupId>
<artifactId>*</artifactId>
</exclusion>
</exclusions>
</dependency>
I assume this is the villain:
[INFO] +- com.onedesk.shared:endpoints:jar:1.0-SNAPSHOT:compile
[INFO] | +- (com.onedesk.shared:dto:jar:1.0-SNAPSHOT:compile - omitted for duplicate)
[INFO] | +- org.springframework:spring-context:jar:4.2.6.RELEASE:compile (version managed from 4.2.7.RELEASE)
[INFO] | | +- org.springframework:spring- aop:jar:4.2.6.RELEASE:compile
[INFO] | | | +- aopalliance:aopalliance:jar:1.0:compile
[INFO] | | | +- (org.springframework:spring-beans:jar:4.2.6.RELEASE:compile
At the end of the dependency chain is Spring Beans with version 4.2.6.
The ObjectProvider, which class isn't found, is available since version 4.3, as you can see in the API:
http://docs.spring.io/spring/docs/current/javadoc-api/org/springframework/beans/factory/ObjectProvider.html
You should upgrade the dependency from this artifact com.onedesk.shared:endpoints:jar to spring-context with version 4.3
Even after implementing the accepted solution, I was still having this problem. It turned out the camel dependency manager also needed to be upgraded:
<dependencyManagement>
<dependencies>
<dependency>
<groupId>org.apache.camel</groupId>
<artifactId>camel-parent</artifactId>
<version>2.18.0</version> <--- was 2.17.2
<type>pom</type>
<scope>import</scope>
</dependency>
</dependencies>
</dependencyManagement>

javax.persistence dependency error using spring-context

I am developing an application using spring-data-jpa. The application launches and runs without any problem, but when I want to write unit tests using spring-context, it seems that I have a dependency conflict due to a JPA1 dependency, which seems to be brought by spring-context(provided by spring-web, spring-webmvc, spring-data-jpa).
Here is my Test(shouldn't be relevant, I provide the code just in case):
package com.company.dashboard.core.services.archiving;
import java.util.List;
import org.junit.Before;
import org.junit.Test;
import org.junit.runner.RunWith;
import org.mockito.InjectMocks;
import org.mockito.Mock;
import org.mockito.MockitoAnnotations;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.test.context.ContextConfiguration;
import org.springframework.test.context.junit4.SpringJUnit4ClassRunner;
import com.company.dashboard.config.CoreConfig;
import com.company.dashboard.config.MVCConfig;
import com.company.dashboard.config.PersistenceJPAConfig;
import com.company.dashboard.config.WebAppInitializer;
import com.company.dashboard.core.util.Converter;
import com.company.dashboard.persistence.repository.RecordRepository;
import com.company.dashboard.persistence.repository.RequestRepository;
import com.company.dashboard.rest.domain.RestRequest;
#RunWith(SpringJUnit4ClassRunner.class)
#ContextConfiguration(classes = {MVCConfig.class, PersistenceJPAConfig.class, CoreConfig.class, WebAppInitializer.class})
public class ContextServiceTest {
#Mock
private RequestRepository requestRepository;
#Mock
private RecordRepository recordRepository;
#Mock
private Converter converter ;
#InjectMocks
#Autowired
ArchivingService archivingService;
#Before
public void init() {
MockitoAnnotations.initMocks(this);
}
#Test
public void myTest() {
List<RestRequest> restRequests = archivingService.findLastArchivingRequests("userId", true);
}
}
My Stacktrace:
01-08-2014 15:13:19 ERROR TestContextManager:334 - Caught exception while allowing TestExecutionListener [org.springframework.test.context.support.DependencyInjectionTestExecutionListener#30848636] to prepare test instance [com.company.dashboard.core.services.archiving.ContextServiceTest#4c875c1c]
java.lang.IllegalStateException: Failed to load ApplicationContext
at org.springframework.test.context.CacheAwareContextLoaderDelegate.loadContext(CacheAwareContextLoaderDelegate.java:99)
at org.springframework.test.context.DefaultTestContext.getApplicationContext(DefaultTestContext.java:101)
at org.springframework.test.context.support.DependencyInjectionTestExecutionListener.injectDependencies(DependencyInjectionTestExecutionListener.java:109)
at org.springframework.test.context.support.DependencyInjectionTestExecutionListener.prepareTestInstance(DependencyInjectionTestExecutionListener.java:75)
at org.springframework.test.context.TestContextManager.prepareTestInstance(TestContextManager.java:331)
at org.springframework.test.context.junit4.SpringJUnit4ClassRunner.createTest(SpringJUnit4ClassRunner.java:213)
at org.springframework.test.context.junit4.SpringJUnit4ClassRunner$1.runReflectiveCall(SpringJUnit4ClassRunner.java:290)
at org.junit.internal.runners.model.ReflectiveCallable.run(ReflectiveCallable.java:12)
at org.springframework.test.context.junit4.SpringJUnit4ClassRunner.methodBlock(SpringJUnit4ClassRunner.java:292)
at org.springframework.test.context.junit4.SpringJUnit4ClassRunner.runChild(SpringJUnit4ClassRunner.java:233)
at org.springframework.test.context.junit4.SpringJUnit4ClassRunner.runChild(SpringJUnit4ClassRunner.java:87)
at org.junit.runners.ParentRunner$3.run(ParentRunner.java:238)
at org.junit.runners.ParentRunner$1.schedule(ParentRunner.java:63)
at org.junit.runners.ParentRunner.runChildren(ParentRunner.java:236)
at org.junit.runners.ParentRunner.access$000(ParentRunner.java:53)
at org.junit.runners.ParentRunner$2.evaluate(ParentRunner.java:229)
at org.springframework.test.context.junit4.statements.RunBeforeTestClassCallbacks.evaluate(RunBeforeTestClassCallbacks.java:61)
at org.springframework.test.context.junit4.statements.RunAfterTestClassCallbacks.evaluate(RunAfterTestClassCallbacks.java:71)
at org.junit.runners.ParentRunner.run(ParentRunner.java:309)
at org.springframework.test.context.junit4.SpringJUnit4ClassRunner.run(SpringJUnit4ClassRunner.java:176)
at org.eclipse.jdt.internal.junit4.runner.JUnit4TestReference.run(JUnit4TestReference.java:50)
at org.eclipse.jdt.internal.junit.runner.TestExecution.run(TestExecution.java:38)
at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner.java:459)
at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner.java:675)
at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.run(RemoteTestRunner.java:382)
at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.main(RemoteTestRunner.java:192)
Caused by: org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'exceptionTranslation' defined in class com.company.dashboard.config.PersistenceJPAConfig: Initialization of bean failed; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'entityManagerFactory' defined in class com.company.dashboard.config.PersistenceJPAConfig: 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.doCreateBean(AbstractAutowireCapableBeanFactory.java:547)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:475)
at org.springframework.beans.factory.support.AbstractBeanFactory$1.getObject(AbstractBeanFactory.java:304)
at org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton(DefaultSingletonBeanRegistry.java:228)
at org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:300)
at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:200)
at org.springframework.context.support.PostProcessorRegistrationDelegate.registerBeanPostProcessors(PostProcessorRegistrationDelegate.java:220)
at org.springframework.context.support.AbstractApplicationContext.registerBeanPostProcessors(AbstractApplicationContext.java:618)
at org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:467)
at org.springframework.test.context.support.AbstractGenericContextLoader.loadContext(AbstractGenericContextLoader.java:125)
at org.springframework.test.context.support.AbstractGenericContextLoader.loadContext(AbstractGenericContextLoader.java:60)
at org.springframework.test.context.support.AbstractDelegatingSmartContextLoader.delegateLoading(AbstractDelegatingSmartContextLoader.java:100)
at org.springframework.test.context.support.AbstractDelegatingSmartContextLoader.loadContext(AbstractDelegatingSmartContextLoader.java:250)
at org.springframework.test.context.CacheAwareContextLoaderDelegate.loadContextInternal(CacheAwareContextLoaderDelegate.java:64)
at org.springframework.test.context.CacheAwareContextLoaderDelegate.loadContext(CacheAwareContextLoaderDelegate.java:91)
... 25 more
Caused by: org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'entityManagerFactory' defined in class com.company.dashboard.config.PersistenceJPAConfig: 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:1553)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:539)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:475)
at org.springframework.beans.factory.support.AbstractBeanFactory$1.getObject(AbstractBeanFactory.java:304)
at org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton(DefaultSingletonBeanRegistry.java:228)
at org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:300)
at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:200)
at org.springframework.beans.factory.support.DefaultListableBeanFactory.getBeansOfType(DefaultListableBeanFactory.java:470)
at org.springframework.beans.factory.BeanFactoryUtils.beansOfTypeIncludingAncestors(BeanFactoryUtils.java:277)
at org.springframework.dao.support.PersistenceExceptionTranslationInterceptor.detectPersistenceExceptionTranslators(PersistenceExceptionTranslationInterceptor.java:139)
at org.springframework.dao.support.PersistenceExceptionTranslationInterceptor.<init>(PersistenceExceptionTranslationInterceptor.java:79)
at org.springframework.dao.annotation.PersistenceExceptionTranslationAdvisor.<init>(PersistenceExceptionTranslationAdvisor.java:71)
at org.springframework.dao.annotation.PersistenceExceptionTranslationPostProcessor.setBeanFactory(PersistenceExceptionTranslationPostProcessor.java:84)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.invokeAwareMethods(AbstractAutowireCapableBeanFactory.java:1572)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.initializeBean(AbstractAutowireCapableBeanFactory.java:1540)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:539)
... 39 more
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:567)
at org.hibernate.jpa.boot.internal.EntityManagerFactoryBuilderImpl.<init>(EntityManagerFactoryBuilderImpl.java:212)
at org.hibernate.jpa.boot.spi.Bootstrap.getEntityManagerFactoryBuilder(Bootstrap.java:51)
at org.hibernate.jpa.HibernatePersistenceProvider.getEntityManagerFactoryBuilder(HibernatePersistenceProvider.java:182)
at org.hibernate.jpa.HibernatePersistenceProvider.getEntityManagerFactoryBuilder(HibernatePersistenceProvider.java:177)
at org.hibernate.jpa.HibernatePersistenceProvider.createContainerEntityManagerFactory(HibernatePersistenceProvider.java:152)
at org.springframework.orm.jpa.LocalContainerEntityManagerFactoryBean.createNativeEntityManagerFactory(LocalContainerEntityManagerFactoryBean.java:290)
at org.springframework.orm.jpa.AbstractEntityManagerFactoryBean.afterPropertiesSet(AbstractEntityManagerFactoryBean.java:310)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.invokeInitMethods(AbstractAutowireCapableBeanFactory.java:1612)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.initializeBean(AbstractAutowireCapableBeanFactory.java:1549)
... 54 more
My maven dependency tree:
[INFO] --- maven-dependency-plugin:2.8:tree (default-cli) # software-dashboard ---
[INFO] com.company:software-dashboard:war:0.0.1-SNAPSHOT
[INFO] +- org.springframework:spring-core:jar:4.0.6.RELEASE:compile
[INFO] | \- commons-logging:commons-logging:jar:1.1.3:compile
[INFO] +- org.springframework:spring-web:jar:4.0.6.RELEASE:compile
[INFO] | +- org.springframework:spring-aop:jar:4.0.6.RELEASE:compile
[INFO] | | \- aopalliance:aopalliance:jar:1.0:compile
[INFO] | \- org.springframework:spring-context:jar:4.0.6.RELEASE:compile
[INFO] +- org.springframework:spring-webmvc:jar:4.0.6.RELEASE:compile
[INFO] | \- org.springframework:spring-expression:jar:4.0.6.RELEASE:compile
[INFO] +- org.springframework:spring-beans:jar:4.0.6.RELEASE:compile
[INFO] +- org.springframework.data:spring-data-jpa:jar:1.6.2.RELEASE:compile
[INFO] | +- org.springframework.data:spring-data-commons:jar:1.8.2.RELEASE:compile
[INFO] | +- org.springframework:spring-orm:jar:3.2.10.RELEASE:compile
[INFO] | | \- org.springframework:spring-jdbc:jar:3.2.10.RELEASE:compile
[INFO] | +- org.springframework:spring-tx:jar:3.2.10.RELEASE:compile
[INFO] | +- org.aspectj:aspectjrt:jar:1.8.1:compile
[INFO] | \- org.slf4j:jcl-over-slf4j:jar:1.7.7:compile
[INFO] +- org.springframework:spring-test:jar:4.0.6.RELEASE:compile
[INFO] +- org.apache.maven.plugins:maven-surefire-plugin:jar:2.13:compile
[INFO] | +- org.apache.maven:maven-plugin-api:jar:2.0.9:compile
[INFO] | +- org.apache.maven.surefire:maven-surefire-common:jar:2.13:compile
[INFO] | | +- org.apache.maven.surefire:surefire-booter:jar:2.13:compile
[INFO] | | +- org.apache.maven:maven-artifact:jar:2.0.9:compile
[INFO] | | | \- org.codehaus.plexus:plexus-utils:jar:1.5.1:compile
[INFO] | | +- org.apache.maven:maven-plugin-descriptor:jar:2.0.9:compile
[INFO] | | | \- org.codehaus.plexus:plexus-container-default:jar:1.0-alpha-9-stable-1:compile
[INFO] | | +- org.apache.maven:maven-project:jar:2.0.9:compile
[INFO] | | | +- org.apache.maven:maven-settings:jar:2.0.9:compile
[INFO] | | | +- org.apache.maven:maven-profile:jar:2.0.9:compile
[INFO] | | | +- org.apache.maven:maven-artifact-manager:jar:2.0.9:compile
[INFO] | | | \- org.apache.maven:maven-plugin-registry:jar:2.0.9:compile
[INFO] | | +- org.apache.maven:maven-model:jar:2.0.9:compile
[INFO] | | \- org.apache.maven:maven-core:jar:2.0.9:compile
[INFO] | | +- org.apache.maven:maven-plugin-parameter-documenter:jar:2.0.9:compile
[INFO] | | +- org.apache.maven.reporting:maven-reporting-api:jar:2.0.9:compile
[INFO] | | +- org.apache.maven.wagon:wagon-provider-api:jar:1.0-beta-2:compile
[INFO] | | +- org.apache.maven:maven-repository-metadata:jar:2.0.9:compile
[INFO] | | +- org.apache.maven:maven-error-diagnostics:jar:2.0.9:compile
[INFO] | | +- org.apache.maven:maven-monitor:jar:2.0.9:compile
[INFO] | | \- classworlds:classworlds:jar:1.1:compile
[INFO] | +- org.apache.maven.surefire:surefire-api:jar:2.13:compile
[INFO] | +- org.apache.maven:maven-toolchain:jar:2.0.9:compile
[INFO] | \- org.apache.maven.plugin-tools:maven-plugin-annotations:jar:3.2:compile
[INFO] +- javax.servlet:javax.servlet-api:jar:3.1.0:compile
[INFO] +- com.oracle:ojdbc7:jar:12.1.0.1:compile
[INFO] +- org.hibernate.javax.persistence:hibernate-jpa-2.1-api:jar:1.0.0.Final:compile
[INFO] +- org.hibernate:hibernate-entitymanager:jar:4.3.6.Final:compile
[INFO] | +- org.jboss.logging:jboss-logging:jar:3.1.3.GA:compile
[INFO] | +- org.jboss.logging:jboss-logging-annotations:jar:1.2.0.Beta1:compile
[INFO] | +- org.hibernate:hibernate-core:jar:4.3.6.Final:compile
[INFO] | | +- antlr:antlr:jar:2.7.7:compile
[INFO] | | \- org.jboss:jandex:jar:1.1.0.Final:compile
[INFO] | +- dom4j:dom4j:jar:1.6.1:compile
[INFO] | | \- xml-apis:xml-apis:jar:1.0.b2:compile
[INFO] | +- org.hibernate.common:hibernate-commons-annotations:jar:4.0.5.Final:compile
[INFO] | +- org.jboss.spec.javax.transaction:jboss-transaction-api_1.2_spec:jar:1.0.0.Final:compile
[INFO] | \- org.javassist:javassist:jar:3.18.1-GA:compile
[INFO] +- com.company.software.kernel:API_RMI:jar:4.7.1.1:compile
[INFO] | +- com.company.software.kernel:API_OBJECTS:jar:4.7.1.1:compile
[INFO] | +- com.company.software.kernel:AUTHENT:jar:4.7.1.1:compile
[INFO] | +- com.company.software.kernel:LDAP:jar:4.7.1.1:compile
[INFO] | | \- com.company.software:ACM_TOOLBOX:jar:1.2.2-SNAPSHOT:compile
[INFO] | | \- log4j:log4j:jar:1.2.15:compile
[INFO] | | +- javax.mail:mail:jar:1.4:compile
[INFO] | | | \- javax.activation:activation:jar:1.1:compile
[INFO] | | +- javax.jms:jms:jar:1.1:compile
[INFO] | | +- com.sun.jdmk:jmxtools:jar:1.2.1:compile
[INFO] | | \- com.sun.jmx:jmxri:jar:1.2.1:compile
[INFO] | +- com.company.software.kernel:DB:jar:4.7.1.1:compile
[INFO] | | +- proxool:proxool:jar:0.9.1:compile
[INFO] | | +- com.jolbox:bonecp:jar:0.7.1.RELEASE:compile
[INFO] | | | \- com.google.guava:guava:jar:r08:compile
[INFO] | | +- org.slf4j:slf4j-log4j12:jar:1.6.4:compile
[INFO] | | +- commons-dbcp:commons-dbcp:jar:1.3:compile
[INFO] | | | \- commons-pool:commons-pool:jar:1.5.4:compile
[INFO] | | +- javax.ejb:ejb-api:jar:3.0:runtime
[INFO] | | +- net.sourceforge.jtds:jtds:jar:1.2.5:compile
[INFO] | | +- mysql:mysql-connector-java:jar:5.1.10:compile
[INFO] | | \- ojdbc:ojdbc:jar:14:compile
[INFO] | +- com.company.software.kernel:GLOBAL:jar:4.7.1.1:compile
[INFO] | +- org.apache.cxf:cxf-bundle:jar:2.4.0:compile
[INFO] | | +- org.apache.ws.xmlschema:xmlschema-core:jar:2.0:compile
[INFO] | | +- wsdl4j:wsdl4j:jar:1.6.2:compile
[INFO] | | \- org.apache.neethi:neethi:jar:3.0.0:compile
[INFO] | +- org.apache.geronimo.specs:geronimo-servlet_3.0_spec:jar:1.0:compile
[INFO] | +- org.apache.geronimo.specs:geronimo-jaxws_2.2_spec:jar:1.0:compile
[INFO] | +- org.apache.geronimo.specs:geronimo-ws-metadata_2.0_spec:jar:1.1.3:compile
[INFO] | +- org.jasig.cas.client:cas-client-core:jar:3.2.1:compile
[INFO] | +- com.unboundid:unboundid-ldapsdk:jar:2.3.1:runtime
[INFO] | \- javax.xml.bind:jaxb-api:jar:2.2.1:compile
[INFO] +- org.slf4j:slf4j-api:jar:1.7.7:compile
[INFO] +- org.apache.logging.log4j:log4j-api:jar:2.0:compile
[INFO] +- org.apache.logging.log4j:log4j-core:jar:2.0:compile
[INFO] +- net.sf.dozer:dozer:jar:5.5.1:compile
[INFO] | +- commons-beanutils:commons-beanutils:jar:1.9.1:compile
[INFO] | | \- commons-collections:commons-collections:jar:3.2.1:compile
[INFO] | \- org.apache.commons:commons-lang3:jar:3.2.1:compile
[INFO] +- com.fasterxml.jackson.core:jackson-databind:jar:2.4.0:compile
[INFO] | +- com.fasterxml.jackson.core:jackson-annotations:jar:2.4.0:compile
[INFO] | \- com.fasterxml.jackson.core:jackson-core:jar:2.4.0:compile
[INFO] +- javassist:javassist:jar:3.12.1.GA:compile
[INFO] +- proxool:cglib:jar:0.9.1:provided
[INFO] +- org.mockito:mockito-all:jar:1.9.5:compile
[INFO] +- org.testng:testng:jar:6.8.8:test
[INFO] | +- org.beanshell:bsh:jar:2.0b4:test
[INFO] | \- com.beust:jcommander:jar:1.27:test
[INFO] \- junit:junit:jar:4.11:test
[INFO] \- org.hamcrest:hamcrest-core:jar:1.3:test
I know that the PersistenceUnit comes from following jar:
javax.persistence - persistence-api-1.0.2.jar - M2_REPO/javax/persistence/persistence-api/1.0.2 - /home/user/.m2/repository/javax/persistence/persistence-api/1.0.2/persistence-api-1.0.2.jar - software-dashboard.
I tried excluding the jar in spring web, spring webmvc, spring data jpa using:
<exclusions>
<exclusion>
<groupId>javax.persistence</groupId>
<artifactId>persistence-api</artifactId>
</exclusion>
</exclusions>
but it didn't do the trick.
Finally I tried deleting manually the jar from the classpath but I got a NullPointerException instead. After putting it back manually I get the previous exception again.
Is my understanding of the problem right? If so, what is the right "maven way" to go?
Thanks,
Harald

Resources