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>


免责声明!

本站转载的文章为个人学习借鉴使用,本站对版权不负任何法律责任。如果侵犯了您的隐私权益,请联系本站邮箱yoyou2525@163.com删除。



 
粤ICP备18138465号  © 2018-2025 CODEPRJ.COM