SpringBoot 2.0 +JPA 启动报错
1、原因:实体字段中有某个属性是Object类型的,则启动报错!
2、常见其他错误,导错包。
3、驼峰表示没有转为下划线表示
4、应该导的包 import javax.persistence.*;
Exception encountered during context initialization - cancelling refresh attempt: org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'entityManagerFactory' defined in class path resource [org/springframework/boot/autoconfigure/orm/jpa/HibernateJpaConfiguration.class]: Invocation of init method failed; nested exception is javax.persistence.PersistenceException: [PersistenceUnit: default] Unable to build Hibernate SessionFactory; nested exception is org.hibernate.MappingException: property mapping has wrong number of columns: com.arc.model.enviroment.ProjectEnvironment.sourcePrimary type: object
翻译
在上下文初始化期间遇到异常 - 取消刷新尝试:org.springframework.beans.factory.BeanCreationException:在类路径资源中定义名称为'entityManagerFactory'的bean时出错[org / springframework / boot / autoconfigure / orm / jpa / HibernateJpaConfiguration.class] :调用init方法失败; 嵌套异常是javax.persistence.PersistenceException:[PersistenceUnit:default]无法构建Hibernate SessionFactory; 嵌套异常是org.hibernate.MappingException:属性映射列数错误:com.arc.model.enviroment.ProjectEnvironment.sourcePrimary类型:object