添加链接
link管理
链接快照平台
  • 输入网页链接,自动生成快照
  • 标签化管理网页链接

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