Search code examples
jsfjsf-2primefacesexceptionhandler

java.lang.ClassNotFoundException: org.primefaces.application.exceptionhandler.PrimeExceptionHandlerFactory


I am trying to implement Primeface Exception Handler

My faces-config.xml

<?xml version="1.0" encoding="UTF-8"?>
<faces-config
xmlns="http://xmlns.jcp.org/xml/ns/javaee"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://xmlns.jcp.org/xml/ns/javaee http://xmlns.jcp.org/xml/ns/javaee/web-facesconfig_2_2.xsd"
version="2.2">

<!-- JSF and Spring are integrated -->
<application>
    <el-resolver>
        org.springframework.web.jsf.el.SpringBeanFacesELResolver
    </el-resolver>
</application>

</faces-config>

when I add the primefaces EL Resolver and factory in config, as follow, my tomcat fail start.

<?xml version="1.0" encoding="UTF-8"?>
<faces-config
xmlns="http://xmlns.jcp.org/xml/ns/javaee"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://xmlns.jcp.org/xml/ns/javaee http://xmlns.jcp.org/xml/ns/javaee/web-facesconfig_2_2.xsd"
version="2.2">

<!-- JSF and Spring are integrated -->
<application>
    <el-resolver>
        org.springframework.web.jsf.el.SpringBeanFacesELResolver
    </el-resolver>
    <el-resolver>
        org.primefaces.application.exceptionhandler.PrimeExceptionHandlerELResolver
    </el-resolver>
</application>

<factory>
    <exception-handler-factory>
        org.primefaces.application.exceptionhandler.PrimeExceptionHandlerFactory
    </exception-handler-factory>
</factory>

</faces-config>

enter image description here

any update ?

-----------EDIT----------

I changes the tomcat version from 7.0.42 to 7.0.64, it showing me the following exception.

SEVERE: Critical error during deployment: 
com.sun.faces.config.ConfigurationException: Factory 'javax.faces.context.ExceptionHandlerFactory' was not configured properly. 
Caused by: javax.faces.FacesException: org.primefaces.application.exceptionhandler.PrimeExceptionHandlerFactory
Caused by: java.lang.ClassNotFoundException: org.primefaces.application.exceptionhandler.PrimeExceptionHandlerFactory 

for detail in exception , please click Exception Detail


Solution

  • So the solution was to include the right version of PrimeFaces (5.0), previous versions did not contain this class.