使用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>