为了账号安全,请及时绑定邮箱和手机立即绑定

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

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

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 回答

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

0 回复 有任何疑惑可以回复我~

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


0 回复 有任何疑惑可以回复我~

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

1 回复 有任何疑惑可以回复我~

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

0 回复 有任何疑惑可以回复我~

解决了吗兄弟

0 回复 有任何疑惑可以回复我~

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

0 回复 有任何疑惑可以回复我~

举报

0/150
提交
取消

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

我要回答 关注问题
意见反馈 帮助中心 APP下载
官方微信