运行报错Field girlRepository in com.imooc.controller.GirlController required a bean named 'entityManagerFactory' that could not be found.请问是怎么回事?

来源:2-3 使用AOP处理请求(下)

萝卜小木头

2018-06-02 23:33

***************************

APPLICATION FAILED TO START

***************************


Description:


Field girlRepository in com.imooc.controller.GirlController required a bean named 'entityManagerFactory' that could not be found.



Action:


Consider defining a bean named 'entityManagerFactory' in your configuration.



Process finished with exit code 1


写回答 关注

6回答

  • 小蜗牛有大理想
    2020-12-20 16:23:07

    https://blog.csdn.net/Julycaka/article/details/80622754?utm_medium=distribute.pc_relevant_t0.none-task-blog-BlogCommendFromMachineLearnPai2-1.control&depth_1-utm_source=distribute.pc_relevant_t0.none-task-blog-BlogCommendFromMachineLearnPai2-1.control

  • 慕容4497254
    2018-11-02 19:31:06

    将girlRepository.findOne(id); 改为 girlRepository.findById(id).orElse(null); 或 girlRepository.findById(id).get();


  • 萝卜小木头
    2018-06-10 09:19:36

    https://stackoverflow.com/questions/42182426/spring-boot-repository-field-required-a-bean-named-entitymanagerfactory-that直接看这个解答吧,解决了

  • 萝卜小木头
    2018-06-09 21:31:22

    没有呀,我这是直接用的师兄代码都不行

  • qq_d_134
    2018-06-09 15:39:33

    解决了吗兄弟

  • qq_哥活的有模有样_0
    2018-06-03 16:33:03

    是不是girl实体少了@entity注解

Spring Boot进阶之Web进阶

《2小时学习Spring Boot》之进阶教程,针对Web方面的相关技巧

104040 学习 · 393 问题

查看课程

相似问题