SpringBoot 3 migration JPA issue

50 Views Asked by At

Getting below error while migrating to SpringBoot 3.0

ConfigServletWebServerApplicationContext:624 : Exception encountered during context initialization - cancelling refresh attempt: org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'jpaSharedEM_entityManagerFactory': Cannot resolve reference to bean 'entityManagerFactory' while setting constructor argument

I've two datasources defined. One as @Primary.

JPA dependencies:

org.springframework.boot:spring-boot-starter-data-jpa:jar:3.1.6:compile [INFO] | - org.hibernate.orm:hibernate-core:jar:6.2.13.Final:compile

org.springframework.data:spring-data-jpa:jar:3.1.8:compile [INFO] | +- org.springframework.data:spring-data-commons:jar:3.1.6:compile

org.hibernate.validator:hibernate-validator:jar:8.0.1.Final:compile [INFO] | +- jakarta.validation:jakarta.validation-api:jar:3.0.2:compile

I'm excluding spring-data-jpa from spring-boot-starter-data-jpa and adding it manually.

Plz help to understand what's wrong

0

There are 0 best solutions below