I am trying to deploy a spring boot application (bundled as war) in tomcat. While starting up the tomcat, it throws error
Post-processing of merged bean definition failed; nested exception is java.lang.NoSuchMethodError: javax.persistence.PersistenceContext.synchronization()Ljavax/persistence/SynchronizationType
I know this could be either because of method is not found at runtime or tomcat is loading some other jar which does not have this method. I checked from where tomcat is trying to load this module and it loaded from correct jar file.
[Loaded javax.persistence.SynchronizationType from file:/home/ubuntu/apache-tomcat-8.5.33/webapps/myapp%23%23003/WEB-INF/lib/hibernate-jpa-2.1-api-1.0.0.Final.jar]
I am not sure why am i still getting this error.
UPDATE
Followings are my dependency related to JPA and hibernate
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-data-jpa</artifactId>
</dependency>
<dependency>
<groupId>com.vladmihalcea</groupId>
<artifactId>hibernate-types-52</artifactId>
<version>2.2.1</version>
</dependency>