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


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

Add the following libraries inside pom.xml (Maven)

  <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.1.0</version>
 </dependency>
Advertisements

java.lang.ClassNotFoundException: javax.faces.webapp.FacesServlet Eclipse luna with correct libraries


java.lang.ClassNotFoundException: javax.faces.webapp.FacesServlet
at org.apache.catalina.loader.WebappClassLoaderBase.loadClass(WebappClassLoaderBase.java:1305)
at org.apache.catalina.loader.WebappClassLoaderBase.loadClass(WebappClassLoaderBase.java:1157)
at org.apache.catalina.core.DefaultInstanceManager.loadClass(DefaultInstanceManager.java:520)
at org.apache.catalina.core.DefaultInstanceManager.loadClassMaybePrivileged(DefaultInstanceManager.java:501)
at org.apache.catalina.core.DefaultInstanceManager.newInstance(DefaultInstanceManager.java:120)
at org.apache.catalina.core.StandardWrapper.loadServlet(StandardWrapper.java:1095)
at org.apache.catalina.core.StandardWrapper.load(StandardWrapper.java:1031)
at org.apache.catalina.core.StandardContext.loadOnStartup(StandardContext.java:4914)
at org.apache.catalina.core.StandardContext.startInternal(StandardContext.java:5201)
at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:150)
at org.apache.catalina.core.ContainerBase$StartChild.call(ContainerBase.java:1409)
at org.apache.catalina.core.ContainerBase$StartChild.call(ContainerBase.java:1399)
at java.util.concurrent.FutureTask.run(Unknown Source)
at java.util.concurrent.ThreadPoolExecutor.runWorker(Unknown Source)

solution follows

if you have related jars and getting the exception above

1

click right on project / click properties and select Deployment Assembly

da

and do the following steps click add

2

select java build path entries

3

add maven dependencies and redeploy your code

4

How to configure the hot deployment (publishing) for Apache Tomcat on Eclipse IDE


If you want to change the default deployment of Eclipse Apache Tomcat configuration;

Just follow the following procedure on Eclipse IDE;

Firstly, just click on Apache Tomcat Icon under Servers View

Secondly, from the Server Configuration windows just change the hot deployment property like the following one;

You can choose under the Publishing tab such as Never publish automatically which will prevent Eclipse publishing whenever you make a change on the Java source files.