spring-boot-starter-data-jpa

如题:
具体报错:https://blog.csdn.net/Dark_Blue__/article/details/118540563
报错:
Closing JPA EntityManagerFactory for persistence unit 'default'
问题:
为什么spring-boot-starter-data-jpa 一定要引入spring-boot-starter-web?
不引入就会报如上的错误

因为没有容器启动,单纯只是main方法,所以才会启动就自动关停了
猜测不是依赖的问题

spring-boot-starter-data-jpa 依赖 spring-boot-starter-web中一些jar。正常情况一般也需要引入,controller端要调用数据库相关服务接口。如果对你有帮助,请采纳