2015-09-07 68 views
0

我想實現Primeface Exception Handler拋出java.lang.ClassNotFoundException:org.primefaces.application.exceptionhandler.PrimeExceptionHandlerFactory

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> 

當我添加了primefaces EL解析器和工廠在配置,如下,我的tomcat失敗開始。

<?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

任何更新?

----------- ----------編輯

我改變從7.0.42 tomcat的版本7.0.64,它顯示我以下例外。

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 

在異常詳細信息,請點擊Exception Detail

+0

你在catalina.out日誌文件中有什麼? –

+0

@GergelyBacso我只是改變到下一個版本,現在它顯示控制檯上的原因。 PLZ看到我的編輯在上面的帖子。謝謝 –

+0

奇怪。你的WEB-INF/lib中有包含PrimeExceptionHandlerFactory.class的jar嗎? –

回答

1

因此,解決辦法是包括PrimeFaces的正確版本(5.0),以前的版本不包含這個類。

相關問題