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>

posted @ 2017-06-21 14:57  Kevin_Zhou_9  阅读(3925)  评论(0编辑  收藏  举报