Skip to content Skip to sidebar Skip to footer

Bean Named 'entitymanagerfactory' Could Not Be Found

My application fails to start. It consists of Spring Boot + JPA + SQLite. But Spring Boot and MySQL are working fine. I don't understand why this happens. The error is bean named

Solution 1:

The problem here is you autowired an EntityManagerFactory in your MyController class. EntityManagerFactory is not able to be injected directly by @Autowired or @Resource

If you need dependency injection for EntityMananger, use

@PersistenceContextprivate EntityManager entityManager;

Post a Comment for "Bean Named 'entitymanagerfactory' Could Not Be Found"