java.lang.ClassNotFoundException : com.sun.faces.config.ConfigureListener

JSF is usually bundled in full fledged Java EE application servers such as GlassFish, JBoss AS/EAP, WildFly, WebSphere, WebLogic, etc. However, Tomcat is a barebones JSP/Servlet container which bundles only the JSP and Servlet APIs, no JSF API.

If you want to use JSF on Tomcat, then you’d need to bundle the JSF libraries along with the webapp in its /WEB-INF/lib folder, or to install JSF in Tomcat by placing the JSF libraries in its /lib folder. Apparently that application is designed for real Java EE applications servers and hence doesn’t bundle the JSF libraries in /WEB-INF/lib.

There are two JSF implementations available, Mojarra and MyFaces. The com.sun.faces package indicates Mojarra, so download that one and put it in webapp’s runtime classpath (i.e. either in webapp’s /WEB-INF/lib or in Tomcat’s /lib).


Another possible cause is that you deployed the project to a Java EE application server which uses MyFaces instead of Mojarra, while the project was apparently initially developed for Mojarra. That listener is namely Mojarra specific. In such case, you’d better remove the entire <listener> entry from web.xml.

In any case, the explicit registration of Mojarra’s ConfigureListener in web.xml is actually only necessary to workaround old buggy servers such as GlassFish v3 and Jetty who failed to find the listener in Mojarra’s TLD file. When deployed to a decent server, the whole <listener> entry is unnecessary.

See also:

Leave a Comment