java.lang.ClassFormatError: Absent Code attribute in method that is not native or abstract in class
使用junit单元测试的时候报错:
java.lang.ClassFormatError: Absent Code attribute in method that is not native or abstract in class
解决方法:
将 javaee-api jar包
<groupId>javax</groupId>
<artifactId>javaee-api</artifactId>
换为以下jar包
<dependency>
<groupId>javax.servlet</groupId>
<artifactId>javax.servlet-api</artifactId>
<version>3.1.0</version>
<scope>provided</scope>
</dependency>