Skip to content

Cannot resolve reference to bean 'jpaSharedEM_entityManagerFactory' while setting bean property 'entityManager' - On Upgrading to Spring 3 #3616

@deepthyl

Description

@deepthyl

Hello,
am currently in process of migrating an application from Spring boot 2.7.0 to 3.3.3(java17). I have updated the soring starter and all associated dependencies. However, on starting of the application I am facing an issue

Logs: Cannot resolve reference to bean 'jpaSharedEM_entityManagerFactory' while setting bean property 'entityManager "message":"Error creating bean with name 'UserDetailsService': Unsatisfied dependency expressed through field 'userRepository': Error creating bean with name 'userRepository' defined in com.mazdl.studio.repository.UserRepository defined in @EnableJpaRepositories declared on StudioApplication: Cannot resolve reference to bean 'jpaSharedEM_entityManagerFactory' while setting bean property 'entityManager'","name":"org.springframework.beans.factory.UnsatisfiedDependencyException"

StudioApplication.java

@SpringBootApplication(scanBasePackages = "com.mazdl.studio")
@EnableAutoConfiguration
@ComponentScan(basePackages={"com.mazdl.studio"})
@EnableJpaRepositories
@EntityScan("com.mazdl.studio.entity")
@EnableCaching
@EnableTransactionManagement
public class StudioApplication {

public static void main(String[] args) {
   
    SpringApplication.run(StudioApplication.class, args);
}

Can anyone help on this?

I have tried to give the basepackages in Jparepositories .

Can anyone help on this?

I have added all the necessary annotations and also tried to give the basepackages in Jparepositories . Also changed all references to jakarta

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions