spring运行时没有问题,在单元测试时,出现java.lang.ClassFormatError错误

Caused by: java.lang.ClassFormatError: Absent Code attribute in method that is not native or abstract in class file javax/persistence/PersistenceContextType

 

出现这个问题,找了半天是javaee-api.jar引入导致了这个问题,在pom.xml文件中注释掉。就没有问题了。具体为什么,自己查找资料。

原文地址:https://www.cnblogs.com/LvLoveYuForever/p/6435198.html