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