当你安装了jdk11,满心欢喜地开始编写项目时,有可能会踩到各种各样的坑,今天,我踩到了一个比较大的坑……从网上找了半天才找到解决方法。。在这里总结一下。
报错信息(截取一部分):
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: Could not get constructor for org.hibernate.persister.entity.SingleTableEntityPersister
找这个问题找了很久,有的说是因为注解错了,有的说是包冲突,事实上,代码没问题,是jdk的问题。
需要加上依赖:
<dependency>
<groupId>org.javassist</groupId>
<arti