org.springframework.transaction.CannotCreateTransactionException: Could not open JPA EntityManager for transaction; nested exception is java.lang.NoSuchMethodError: org.hibernate.Session.getFlushMode()Lorg/hibernate/FlushMode;

今天在学习spring data JPA多表操作时,运行单元测试报错:
SpringDataJPA单元测试报错:Could not open JPA EntityManager for transaction;
解决方案:
这是因为Hibernate版本不兼容问题,原来是用5.2.17的:

SpringDataJPA单元测试报错:Could not open JPA EntityManager for transaction;
然后,我换成了5.0.7版本的:
SpringDataJPA单元测试报错:Could not open JPA EntityManager for transaction;
最终,运行成功!

相关文章:

  • 2022-12-23
  • 2022-12-23
  • 2021-08-24
  • 2022-12-23
  • 2021-12-06
  • 2022-12-23
  • 2022-12-23
猜你喜欢
  • 2022-12-23
  • 2022-12-23
  • 2021-12-16
  • 2022-12-23
  • 2021-06-23
相关资源
相似解决方案