0
点赞
收藏
分享

微信扫一扫

A component required a bean named 'entityManagerFactory' that could not be found.

盖码范 2024-04-26 阅读 6

jpa引入项目,却无法运行,说找不到,工厂管理类,原因是谷歌的默认类指向另一个地方,需要手动在application那里,手动添加一个自动寻找的字段

package com.example;


import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.boot.autoconfigure.jdbc.DataSourceAutoConfiguration;

/**
* @author zhangzhiwei
*/

@SpringBootApplication(exclude = {DataSourceAutoConfiguration.class})
public class DemoBackendApplication {
public static void main(String[] args) {
SpringApplication.run(DemoBackendApplication.class, args);
}
}
举报

相关推荐

0 条评论