java.lang.ClassFormatError: Absent Code attribute in method that is not native or abstract in class file javax/faces/webapp/FacesServlet

Solution 1:

I have the same problem as you and found out that change from servlet-api to javax.servlet.api will fix the problem. Hope this help. Please note that, I am using Juno Eclipse, Tomcat 7, Dynamic Web Module 3.0, and JDK 1.7.

<dependency>
  <groupId>com.sun.faces</groupId>
  <artifactId>jsf-api</artifactId>
  <version>2.1.13</version>
</dependency>
<dependency>
  <groupId>com.sun.faces</groupId>
  <artifactId>jsf-impl</artifactId>
  <version>2.1.13</version>
</dependency>
<dependency>
  <groupId>javax.servlet</groupId>
  <artifactId>javax.servlet-api</artifactId>
  <version>3.0.1</version>
</dependency>

Solution 2:

I have the same problem, and it seams somehow to

<groupId>javax</groupId>
<artifactId>javaee-web-api</artifactId>

or

<groupId>javax</groupId>
<artifactId>javaee-api</artifactId>

after setting them to scope provides (or delete them at all when you start an server in maven test) it starts working for me.

@See this Blog: java.lang.ClassFormatError : Absent Code attribute in method that is not native or abstract in class file … - It discuss the problem for javax.persistence.GenerationType but I think you and I hit the same problem.