使用spring boot对项目改造,启动报错:
Caused by: java.lang.IllegalArgumentException: At least one JPA metamodel must be present!
估计是跟多个数据源有关,改成如下这样就可以了:
@SpringBootApplication
@EnableAutoConfiguration(exclude={
JpaRepositoriesAutoConfiguration.class//禁止springboot自动加载持久化bean
})
public class DemoApplication {
//spring应用启动应用
public static void main(String[] args) {
SpringApplication.run(DemoApplication.class, args);
}
}