spring boot entry class
package com.test;
@SpringBootApplication(exclude={
DataSourceAutoConfiguration.class,
DataSourceTransactionManagerA
You need to provide the package name to Spring to scan the repositories from, using @EnableJpaRepositories
annnotation, e.g.:
@SpringBootApplication
@EnableJpaRepositories("com.test.assetmanagementdigital.repository")
public class AssetManagementDigital2Application
Here's the documentation.
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.