Application run failed error creating bean with name 'entityManagerFactory'defined in class path

现象

error creating bean with name 'entityManagerFactory’defined in class path
字面意思是因为表中字段类型和期待的类型不一致,导致无法加载beanApplication run failed error creating bean with name ‘entityManagerFactory‘defined in class path
Application run failed error creating bean with name ‘entityManagerFactory‘defined in class path

found bigserial but expecting int4Application run failed error creating bean with name ‘entityManagerFactory‘defined in class path

原因

启动配置的时候没有选use classpath of modeule
spring boot项目导入找不到主类
Application run failed error creating bean with name ‘entityManagerFactory‘defined in class path
一开始以为是库配错了,或者是字段类型建错,但是检查了之后发现类型没有错误,因此报这个错的时候不一定是字段的问题,也可能是加载配置的问题

解决方案

在配置项中配置主类所在的位置

Application run failed error creating bean with name ‘entityManagerFactory‘defined in class path

其实一开始启动的时候有报错但是没太在意
Application run failed error creating bean with name ‘entityManagerFactory‘defined in class path
直接点了continue anyway
Application run failed error creating bean with name ‘entityManagerFactory‘defined in class path
仔细想想最开始报错的时候已经说了,是在这个classpath下无法初始方法,导致的字段的问题
Application run failed error creating bean with name ‘entityManagerFactory‘defined in class path

相关文章: