◎筱米加步枪◎.Blog

Happy coding

Maven工程上Absent Code attribute in method that is not native or abstract in class file解决方案。

在Maven工程上进行JUnit测试出现如下错误:

Caused by: java.lang.ClassFormatError: Absent Code attribute in method that is not native or abstract in class file javax/persistence/CascadeType

 

解决方案:
在pom.xml文件中添加jboss-javaee6依赖

<dependency>
   <groupId>org.jboss.spec</groupId>
   <artifactId>jboss-javaee-6.0</artifactId>
   <version>2.0.0.Final</version>
   <type>pom</type>
   <scope>provided</scope>
</dependency>