spring boot entry class
package com.test;
@SpringBootApplication(exclude={
DataSourceAutoConfiguration.class,
DataSourceTransactionManagerA
Your Spring configuration is not correct.
The spring-boot-starter-data-jpa already provides the hibernate-core dependency. While you declare it with a specific version :
compile group: 'org.hibernate', name: 'hibernate-core', version: '4.2.2.Final'
You have not to declare it a second time as your specified version may be different and not compatible with the version provided by the starter.
And according to your error, it seems be the case as the javax.persistence.PersistenceContext.synchronization() method is not found at runtime.
Post-processing of merged bean definition failed; nested exception is
java.lang.NoSuchMethodError:javax.persistence.PersistenceContext.synchronization()Ljavax/persistence/SynchronizationType;
Just remove the hibernate-core dependency and it should work.