[英]Primefaces extensions ajaxErrorHandler not working
On WildFly 8-1 I have primefaces-5.1.jar
and primefaces-extensions-2.1.0.jar
in my webapps WEB-INF/lib
directory. 在WildFly 8-1上,我的webapps
WEB-INF/lib
目录中有primefaces-5.1.jar
和primefaces-extensions-2.1.0.jar
。
I have configured WEB-INF/faces-config.xml
: 我已经配置了
WEB-INF/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">
<application>
<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>
I have the following JSF. 我有以下JSF。
<!DOCTYPE html>
<html xmlns="http://www.w3.org/1999/xhtml"
xmlns:ui="http://xmlns.jcp.org/jsf/facelets"
xmlns:h="http://xmlns.jcp.org/jsf/html"
xmlns:f="http://xmlns.jcp.org/jsf/core"
xmlns:p="http://primefaces.org/ui"
xmlns:pe="http://primefaces.org/ui/extensions">
<h:head></h:head>
<h:body>
<h:form id="form">
<pe:ajaxErrorHandler body="ERROR"/>
<p:commandButton actionListener="#{dossierResumen.excepcion}" value="Excepción"/>
</h:form>
</h:body>
</html>
where DossierResumen#excepcion()
is DossierResumen#excepcion()
在哪里
public void excepcion() {
throw new NullPointerException("EXCEPCION! EXCEPCION!");
}
When I click the button, I get no popups at all; 当我单击按钮时,根本没有弹出窗口。 the page gets redirected to the URL for error 500 defined in
web.xml
. 该页面将重定向到
web.xml
定义的错误500的URL。 In the logs, I get the following wall of stacktrace: 在日志中,我得到了stacktrace的以下内容:
What am I doing wrong? 我究竟做错了什么?
15:44:14,206 ERROR [stderr] (default task-42) java.lang.NullPointerException: EXCEPCION!
15:44:14,206错误[stderr](默认任务42)java.lang.NullPointerException:EXCEPCION! EXCEPCION!
超越! 15:44:14,206 ERROR [stderr] (default task-42) at es.imasmallorca.selene.webone.jsf.controller.dossier.DossierResumen.excepcion(DossierResumen.java:55) 15:44:14,206 ERROR [stderr] (default task-42) at es.imasmallorca.selene.webone.jsf.controller.dossier.DossierResumen$Proxy$_$$ WeldClientProxy.excepcion(Unknown Source) 15:44:14,206 ERROR [stderr] (default task-42) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) 15:44:14,206 ERROR [stderr] (default task-42) at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57) 15:44:14,207 ERROR [stderr] (default task-42) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) 15:44:14,207 ERROR [stderr] (default task-42) at java.lang.reflect.Method.invoke(Method.java:606) 15:44:14,207 ERROR [stderr] (default task-42) at com.sun.el.parser.AstValue.invoke(AstValue.java:275) 15:44:14,207 ERROR [stderr] (default task-42) at com.sun.el.MethodExpressionImpl.invoke(MethodExpressionImpl.
15:44:14,206错误[stderr](默认任务42)位于es.imasmallorca.selene.webone.jsf.controller.dossier.DossierResumen.excepcion(DossierResumen.java:55)15:44:14,206错误[stderr](默认任务42)位于es.imasmallorca.selene.webone.jsf.controller.dossier.DossierResumen $ Proxy $ _ $$ WeldClientProxy.excepcion(未知源)15:44:14,206错误[stderr](默认任务42)位于sun.reflect.NativeMethodAccessorImpl.invoke0(本机方法)15:44:14,206在sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)15:44:14,207错误[stderr](默认任务42)[stderr] (默认任务42)在sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)15:44:14,207错误[stderr](默认任务42)在java.lang.reflect.Method.invoke(Method.java :606)15:44:14,207 com.sun.el.parser.AstValue.invoke(AstValue.java:275)出现[stderr](默认任务-42)15:44:14,207错误[stderr](默认任务- 42)在com.sun.el.MethodExpressionImpl.invoke(MethodExpressionImpl。 java:304) 15:44:14,207 ERROR [stderr] (default task-42) at org.jboss.weld.util.el.ForwardingMethodExpression.invoke(ForwardingMethodExpression.java:40) 15:44:14,207 ERROR [stderr] (default task-42) at org.jboss.weld.el.WeldMethodExpression.invoke(WeldMethodExpression.java:50) 15:44:14,208 ERROR [stderr] (default task-42) at org.jboss.weld.util.el.ForwardingMethodExpression.invoke(ForwardingMethodExpression.java:40) 15:44:14,208 ERROR [stderr] (default task-42) at org.jboss.weld.el.WeldMethodExpression.invoke(WeldMethodExpression.java:50) 15:44:14,208 ERROR [stderr] (default task-42) at javax.faces.event.MethodExpressionActionListener.processAction(MethodExpressionActionListener.java:149) 15:44:14,208 ERROR [stderr] (default task-42) at javax.faces.event.ActionEvent.processListener(ActionEvent.java:88) 15:44:14,208 ERROR [stderr] (default task-42) at javax.faces.component.UIComponentBase.broadcast(UIComponentBase.java:813) 15:44:14,208 ERROR [stderr] (default task-42) at javax.faces.com
java:304)15:44:14,207错误[stderr](默认任务42)位于org.jboss.weld.util.el.ForwardingMethodExpression.invoke(ForwardingMethodExpression.java:40)15:44:14,207错误[stderr]( org.jboss.weld.el.WeldMethodExpression.invoke(WeldMethodExpression.java:50)上的默认任务42)15:44:14,208 org.jboss.weld.util.el上的错误[stderr](默认任务42)。 ForwardingMethodExpression.invoke(ForwardingMethodExpression.java:40)15:44:14,208 org.jboss.weld.el.WeldMethodExpression.invoke(WeldMethodExpression.java:50)出现错误[stderr](默认任务42),错误15:44:14,208 javax.faces.event.MethodExpressionActionListener.processAction(MethodExpressionActionListener.java:149)上的[stderr](默认任务42)15:44:14,208错误javax.faces.event.ActionEvent上的[stderr](默认任务42)。 processListener(ActionEvent.java:88)15:44:14,208错误[stderr](默认任务42)在javax.faces.component.UIComponentBase.broadcast(UIComponentBase.java:813)15:44:14,208错误[stderr](默认任务42)在javax.faces.com ponent.UICommand.broadcast(UICommand.java:300) 15:44:14,209 ERROR [stderr] (default task-42) at javax.faces.component.UIViewRoot.broadcastEvents(UIViewRoot.java:790) 15:44:14,209 ERROR [stderr] (default task-42) at javax.faces.component.UIViewRoot.processApplication(UIViewRoot.java:1282) 15:44:14,209 ERROR [stderr] (default task-42) at com.sun.faces.lifecycle.InvokeApplicationPhase.execute(InvokeApplicationPhase.java:81) 15:44:14,209 ERROR [stderr] (default task-42) at com.sun.faces.lifecycle.Phase.doPhase(Phase.java:101) 15:44:14,209 ERROR [stderr] (default task-42) at com.sun.faces.lifecycle.LifecycleImpl.execute(LifecycleImpl.java:198) 15:44:14,209 ERROR [stderr] (default task-42) at javax.faces.webapp.FacesServlet.service(FacesServlet.java:646) 15:44:14,210 ERROR [stderr] (default task-42) at io.undertow.servlet.handlers.ServletHandler.handleRequest(ServletHandler.java:85) 15:44:14,210 ERROR [stderr] (default task-42) at io.undertow.servlet.handlers.security.ServletSecurityRoleHand
ponent.UICommand.broadcast(UICommand.java:300)15:44:14,209错误[stderr](默认任务42)在javax.faces.component.UIViewRoot.broadcastEvents(UIViewRoot.java:790)15:44:14,209错误javax.faces.component.UIViewRoot.processApplication(UIViewRoot.java:1282)上的[stderr](默认任务42)15:44:14,209 com.sun.faces.lifecycle上的[stderr](默认任务42)错误。 InvokeApplicationPhase.execute(InvokeApplicationPhase.java:81)15:44:14,209错误[stderr](默认任务42)位于com.sun.faces.lifecycle.Phase.doPhase(Phase.java:101)15:44:14,209错误com.sun.faces.lifecycle.LifecycleImpl.execute(LifecycleImpl.java:198)上的[stderr](默认任务42)15:44:14,209错误javax.faces.webapp上的[stderr](默认任务42)。 FacesServlet.service(FacesServlet.java:646)15:44:14,210错误[stderr](默认任务42)位于io.undertow.servlet.handlers.ServletHandler.handleRequest(ServletHandler.java:85)15:44:14,210错误[stderr](默认任务42)位于io.undertow.servlet.handlers.security.ServletSecurityRoleHand ler.handleRequest(ServletSecurityRoleHandler.java:61) 15:44:14,210 ERROR [stderr] (default task-42) at io.undertow.servlet.handlers.ServletDispatchingHandler.handleRequest(ServletDispatchingHandler.java:36) 15:44:14,210 ERROR [stderr] (default task-42) at org.wildfly.extension.undertow.security.SecurityContextAssociationHandler.handleRequest(SecurityContextAssociationHandler.java:78) 15:44:14,210 ERROR [stderr] (default task-42) at io.undertow.server.handlers.PredicateHandler.handleRequest(PredicateHandler.java:25) 15:44:14,210 ERROR [stderr] (default task-42) at io.undertow.servlet.handlers.security.SSLInformationAssociationHandler.handleRequest(SSLInformationAssociationHandler.java:113) 15:44:14,211 ERROR [stderr] (default task-42) at io.undertow.servlet.handlers.security.ServletAuthenticationCallHandler.handleRequest(ServletAuthenticationCallHandler.java:56) 15:44:14,211 ERROR [stderr] (default task-42) at io.undertow.server.handlers.PredicateHandler.handleRequest(PredicateHandler.j
ler.handleRequest(ServletSecurityRoleHandler.java:61)15:44:14,210 io.undertow.servlet.handlers.ServletDispatchingHandler.handleRequest(ServletDispatchingHandler.java:36)发生错误[stderr](默认任务42)15:44:14,210错误[stderr](默认任务42)位于org.wildfly.extension.undertow.security.SecurityContextAssociationHandler.handleRequest(SecurityContextAssociationHandler.java:78)15:44:14,210错误[stderr](默认任务42)位于io.undertow。 server.handlers.PredicateHandler.handleRequest(PredicateHandler.java:25)15:44:14,210 io.undertow.servlet.handlers.security.SSLInformationAssociationHandler.handleRequest(SSLInformationAssociationHandler.java:113)出现错误[stderr](默认任务42) 15:44:14,211错误[stderr](默认任务42)位于io.undertow.servlet.handlers.security.ServletAuthenticationCallHandler.handleRequest(ServletAuthenticationCallHandler.java:56)15:44:14,211错误[stderr](默认任务42 ),位于io.undertow.server.handlers.PredicateHandler.handleRequest(PredicateHandler.j ava:25) 15:44:14,211 ERROR [stderr] (default task-42) at io.undertow.security.handlers.AbstractConfidentialityHandler.handleRequest(AbstractConfidentialityHandler.java:45) 15:44:14,211 ERROR [stderr] (default task-42) at io.undertow.servlet.handlers.security.ServletConfidentialityConstraintHandler.handleRequest(ServletConfidentialityConstraintHandler.java:61) 15:44:14,211 ERROR [stderr] (default task-42) at io.undertow.security.handlers.AuthenticationMechanismsHandler.handleRequest(AuthenticationMechanismsHandler.java:58) 15:44:14,212 ERROR [stderr] (default task-42) at io.undertow.servlet.handlers.security.CachedAuthenticatedSessionHandler.handleRequest(CachedAuthenticatedSessionHandler.java:70) 15:44:14,212 ERROR [stderr] (default task-42) at io.undertow.security.handlers.SecurityInitialHandler.handleRequest(SecurityInitialHandler.java:76) 15:44:14,212 ERROR [stderr] (default task-42) at io.undertow.server.handlers.PredicateHandler.handleRequest(PredicateHandler.java:25) 15:44:14,212
ava:25)15:44:14,211 io.undertow.security.handlers.AbstractConfidentialityHandler.handleRequest(AbstractConfidentialityHandler.java:45)发生错误[stderr](默认任务42)15:44:14,211错误[stderr](默认任务-42)在io.undertow.servlet.handlers.security.ServletConfidentialityConstraintHandler.handleRequest(ServletConfidentialityConstraintHandler.java:61)15:44:14,211错误[stderr](默认任务42)在io.undertow.security.handlers.AuthenticationMechanismsHandler处。 handleRequest(AuthenticationMechanismsHandler.java:58)15:44:14,212 io.undertow.servlet.handlers.security.CachedAuthenticatedSessionHandler.handleRequest(CachedAuthenticatedSessionHandler.java:70)出现错误[stderr](默认任务42)15:44:14,212错误io.undertow.security.handlers.SecurityInitialHandler.handleRequest(SecurityInitialHandler.java:76)上的[stderr](默认任务42)在io.undertow.server上错误15:44:14,212错误[stderr](默认任务42)。 handlers.PredicateHandler.handleRequest(PredicateHandler.java:25)15:44:14,212 ERROR [stderr] (default task-42) at org.wildfly.extension.undertow.security.jacc.JACCContextIdHandler.handleRequest(JACCContextIdHandler.java:61) 15:44:14,212 ERROR [stderr] (default task-42) at io.undertow.server.handlers.PredicateHandler.handleRequest(PredicateHandler.java:25) 15:44:14,212 ERROR [stderr] (default task-42) at io.undertow.server.handlers.PredicateHandler.handleRequest(PredicateHandler.java:25) 15:44:14,213 ERROR [stderr] (default task-42) at io.undertow.servlet.handlers.ServletInitialHandler.handleFirstRequest(ServletInitialHandler.java:240) 15:44:14,213 ERROR [stderr] (default task-42) at io.undertow.servlet.handlers.ServletInitialHandler.dispatchRequest(ServletInitialHandler.java:227) 15:44:14,213 ERROR [stderr] (default task-42) at io.undertow.servlet.handlers.ServletInitialHandler.access$000(ServletInitialHandler.java:73) 15:44:14,213 ERROR [stderr] (default task-42) at io.undertow.servlet.handlers.ServletInitialHandler$1.handleRequest(ServletInitialHandler.java:1
io上org.wildfly.extension.undertow.security.jacc.JACCContextIdHandler.handleRequest(JACCContextIdHandler.java:61)15:44:14,212错误[stderr](默认任务42)在io .undertow.server.handlers.PredicateHandler.handleRequest(PredicateHandler.java:25)15:44:14,212 io.undertow.server.handlers.PredicateHandler.handleRequest(PredicateHandler.java:25)出现错误[stderr](默认任务42) )15:44:14,213 io.undertow.servlet.handlers.ServletInitialHandler.handleFirstRequest(ServletInitialHandler.java:240)出现错误[stderr](默认任务42)15:44:14,213错误[stderr](默认任务42)在io.undertow.servlet.handlers.ServletInitialHandler.access $ 000(ServletInitialHandler.ServletInitialHandler.dispatchRequest(ServletInitialHandler.java:227)15:44:14,213错误[stderr](默认任务42) java:73)15:44:14,213错误[stderr](默认任务42)位于io.undertow.servlet.handlers.ServletInitialHandler $ 1.handleRequest(ServletInitialHandler.java:1 46) 15:44:14,213 ERROR [stderr] (default task-42) at io.undertow.server.Connectors.executeRootHandler(Connectors.java:177) 15:44:14,213 ERROR [stderr] (default task-42) at io.undertow.server.HttpServerExchange$1.run(HttpServerExchange.java:727) 15:44:14,214 ERROR [stderr] (default task-42) at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1145) 15:44:14,214 ERROR [stderr] (default task-42) at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:615) 15:44:14,214 ERROR [stderr] (default task-42) at java.lang.Thread.run(Thread.java:745) 15:44:14,214 SEVERE [org.primefaces.application.exceptionhandler.PrimeExceptionHandler] (default task-42) EXCEPCION!
46)io.undertow.server.Connectors.executeRootHandler(Connectors.java:177)15:44:14,213错误[stderr](默认任务42)在15:44:14,213错误[stderr](默认任务42) io.undertow.server.HttpServerExchange $ 1.run(HttpServerExchange.java:727)15:44:14,214 java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1145)上的错误[stderr](默认任务42) :44:14,214在java.util.concurrent.ThreadPoolExecutor $ Worker.run(ThreadPoolExecutor.java:615)时发生[stderr](默认任务42)在Java上出现15:44:14,214在[stderr]中发生错误[stderr](默认任务42) .lang.Thread.run(Thread.java:745)15:44:14,214严重[org.primefaces.application.exceptionhandler.PrimeExceptionHandler](默认任务42)例外! EXCEPCION!: java.lang.NullPointerException: EXCEPCION!
EXCEPCION !: java.lang.NullPointerException:EXCEPCION! EXCEPCION!
超越! at es.imasmallorca.selene.webone.jsf.controller.dossier.DossierResumen.excepcion(DossierResumen.java:55) [classes:] at es.imasmallorca.selene.webone.jsf.controller.dossier.DossierResumen$Proxy$ $$_WeldClientProxy.excepcion(Unknown Source) [classes:] at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) [rt.jar:1.7.0_55] at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57) [rt.jar:1.7.0_55] at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) [rt.jar:1.7.0_55] at java.lang.reflect.Method.invoke(Method.java:606) [rt.jar:1.7.0_55] at com.sun.el.parser.AstValue.invoke(AstValue.java:275) [javax.el-3.0.0.jar:] at com.sun.el.MethodExpressionImpl.invoke(MethodExpressionImpl.java:304) [javax.el-3.0.0.jar:] at org.jboss.weld.util.el.ForwardingMethodExpression.invoke(ForwardingMethodExpression.java:40) [weld-core-impl-2.1.2.Final.jar:2014-01-09 09:23] at org.jboss.weld.el.WeldMethodExpression.invoke(WeldMethodExpression.java
在es.imasmallorca.selene.webone.jsf.controller.dossier.DossierResumen.excepcion(DossierResumen.java:55)[classes:]在es.imasmallorca.selene.webone.jsf.controller.dossier.DossierResumen $ Proxy $ $$ _WeldClientProxy.excepcion(未知来源)[类:]位于sun.reflect.NativeMethodAccessorImpl.invoke0(本地方法)[rt.jar:1.7.0_55]位于sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)[rt。 jar.1.7.0_55]在sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)[rt.jar:1.7.0_55]在java.lang.reflect.Method.invoke(Method.java:606)[rt。 com.sun.el.parser.AstValue.invoke(AstValue.java:275)上的jar:1.7.0_55] [javax.el-3.0.0.jar:] com.sun.el.MethodExpressionImpl.invoke(MethodExpressionImpl。 java:304)[javax.el-3.0.0.jar:] at org.jboss.weld.util.el.ForwardingMethodExpression.invoke(ForwardingMethodExpression.java:40)[weld-core-impl-2.1.2.Final。 jar:2014-01-09 09:23]在org.jboss.weld.el.WeldMethodExpression.invoke(WeldMethodExpression.java :50) [weld-core-impl-2.1.2.Final.jar:2014-01-09 09:23] at org.jboss.weld.util.el.ForwardingMethodExpression.invoke(ForwardingMethodExpression.java:40) [weld-core-impl-2.1.2.Final.jar:2014-01-09 09:23] at org.jboss.weld.el.WeldMethodExpression.invoke(WeldMethodExpression.java:50) [weld-core-impl-2.1.2.Final.jar:2014-01-09 09:23] at javax.faces.event.MethodExpressionActionListener.processAction(MethodExpressionActionListener.java:149) [jboss-jsf-api_2.2_spec-2.2.6.jar:2.2.6] at javax.faces.event.ActionEvent.processListener(ActionEvent.java:88) [jboss-jsf-api_2.2_spec-2.2.6.jar:2.2.6] at javax.faces.component.UIComponentBase.broadcast(UIComponentBase.java:813) [jboss-jsf-api_2.2_spec-2.2.6.jar:2.2.6] at javax.faces.component.UICommand.broadcast(UICommand.java:300) [jboss-jsf-api_2.2_spec-2.2.6.jar:2.2.6] at javax.faces.component.UIViewRoot.broadcastEvents(UIViewRoot.java:790) [jboss-jsf-api_2.2_spec-2.2.6.jar:2.2.6] at javax.faces.component.UIViewRoot.processApplication(UIViewRoot.java:12
:50)[weld-core-impl-2.1.2.Final.jar:2014-01-09 09:23] at org.jboss.weld.util.el.ForwardingMethodExpression.invoke(ForwardingMethodExpression.java:40)[weld -core-impl-2.1.2.Final.jar:2014-01-09 09:23],网址为org.jboss.weld.el.WeldMethodExpression.invoke(WeldMethodExpression.java:50)[weld-core-impl-2.1。 2.Final.jar:2014-01-09 09:23],位于javax.faces.event.MethodExpressionActionListener.processAction(MethodExpressionActionListener.java:149)[jboss-jsf-api_2.2_spec-2.2.6.jar:2.2.6 ]在javax.faces.event.ActionEvent.processListener(ActionEvent.java:88)上[jboss-jsf-api_2.2_spec-2.2.6.jar:2.2.6]在javax.faces.component.UIComponentBase.broadcast(UIComponentBase。 java:813)[jboss-jsf-api_2.2_spec-2.2.6.jar:2.2.6] at javax.faces.component.UICommand.broadcast(UICommand.java:300)[jboss-jsf-api_2.2_spec-2.2 .6.jar:2.2.6],位于javax.faces.component.UIViewRoot.broadcastEvents(UIViewRoot.java:790)[jboss-jsf-api_2.2_spec-2.2.6.jar:2.2.6],位于javax.faces。 component.UIViewRoot.processApplication(UIViewRoot.java:12 82) [jboss-jsf-api_2.2_spec-2.2.6.jar:2.2.6] at com.sun.faces.lifecycle.InvokeApplicationPhase.execute(InvokeApplicationPhase.java:81) [jsf-impl-2.2.6-jbossorg-4.jar:] at com.sun.faces.lifecycle.Phase.doPhase(Phase.java:101) [jsf-impl-2.2.6-jbossorg-4.jar:] at com.sun.faces.lifecycle.LifecycleImpl.execute(LifecycleImpl.java:198) [jsf-impl-2.2.6-jbossorg-4.jar:] at javax.faces.webapp.FacesServlet.service(FacesServlet.java:646) [jboss-jsf-api_2.2_spec-2.2.6.jar:2.2.6] at io.undertow.servlet.handlers.ServletHandler.handleRequest(ServletHandler.java:85) [undertow-servlet-1.0.15.Final.jar:1.0.15.Final] at io.undertow.servlet.handlers.security.ServletSecurityRoleHandler.handleRequest(ServletSecurityRoleHandler.java:61) [undertow-servlet-1.0.15.Final.jar:1.0.15.Final] at io.undertow.servlet.handlers.ServletDispatchingHandler.handleRequest(ServletDispatchingHandler.java:36) [undertow-servlet-1.0.15.Final.jar:1.0.15.Final] at org.wildfly.extension.undertow.security.SecurityContextAssociationHan
82)[jboss-jsf-api_2.2_spec-2.2.6.jar:2.2.6]在com.sun.faces.lifecycle.InvokeApplicationPhase.execute(InvokeApplicationPhase.java:81)[jsf-impl-2.2.6-jbossorg -4.jar:]在com.sun.faces.lifecycle.Phase.doPhase(Phase.java:101)[jsf-impl-2.2.6-jbossorg-4.jar:]在com.sun.faces.lifecycle。 LifecycleImpl.execute(LifecycleImpl.java:198)[jsf-impl-2.2.6-jbossorg-4.jar:]在javax.faces.webapp.FacesServlet.service(FacesServlet.java:646)[jboss-jsf-api_2。 2_spec-2.2.6.jar:2.2.6],位于io.undertow.servlet.handlers.ServletHandler.handleRequest(ServletHandler.java:85)[undertow-servlet-1.0.15.Final.jar:1.0.15.Final]在io.undertow.servlet.handlers.security.ServletSecurityRoleHandler.handleRequest(ServletSecurityRoleHandler.java:61)[undertow-servlet-1.0.15.Final.jar:1.0.15.Final]在io.undertow.servlet.handlers.ServletDispatchingHandler .handleRequest(ServletDispatchingHandler.java:36)[undertow-servlet-1.0.15.Final.jar:1.0.15.Final],位于org.wildfly.extension.undertow.security.SecurityContextAssociationHan dler.handleRequest(SecurityContextAssociationHandler.java:78) at io.undertow.server.handlers.PredicateHandler.handleRequest(PredicateHandler.java:25) [undertow-core-1.0.15.Final.jar:1.0.15.Final] at io.undertow.servlet.handlers.security.SSLInformationAssociationHandler.handleRequest(SSLInformationAssociationHandler.java:113) [undertow-servlet-1.0.15.Final.jar:1.0.15.Final] at io.undertow.servlet.handlers.security.ServletAuthenticationCallHandler.handleRequest(ServletAuthenticationCallHandler.java:56) [undertow-servlet-1.0.15.Final.jar:1.0.15.Final] at io.undertow.server.handlers.PredicateHandler.handleRequest(PredicateHandler.java:25) [undertow-core-1.0.15.Final.jar:1.0.15.Final] at io.undertow.security.handlers.AbstractConfidentialityHandler.handleRequest(AbstractConfidentialityHandler.java:45) [undertow-core-1.0.15.Final.jar:1.0.15.Final] at io.undertow.servlet.handlers.security.ServletConfidentialityConstraintHandler.handleRequest(ServletConfidentialityConstraintHandler.java:61) [un
io的dler.handleRequest(SecurityContextAssociationHandler.java:78)在io.undertow.server.handlers.PredicateHandler.handleRequest(PredicateHandler.java:25)[undertow-core-1.0.15.Final.jar:1.0.15.Final] at io .undertow.servlet.handlers.security.SSLInformationAssociationHandler.handleRequest(SSLInformationAssociationHandler.java:113)[undertow-servlet-1.0.15.Final.jar:1.0.15.Final]位于io.undertow.servlet.handlers.security.ServletAuthenticationCallHandler .handleRequest(ServletAuthenticationCallHandler.java:56)[undertow-servlet-1.0.15.Final.jar:1.0.15.Final]在io.undertow.server.handlers.PredicateHandler.handleRequest(PredicateHandler.java:25)[undertow-核心1.0.15.Final.jar:1.0.15.Final],位于io.undertow.security.handlers.AbstractConfidentialityHandler.handleRequest(AbstractConfidentialityHandler.java:45)[undertow-core-1.0.15.Final.jar:1.0。 15.最后],位于io.undertow.servlet.handlers.security.ServletConfidentialityConstraintHandler.handleRequest(ServletConfidentialityConstraintHandler.java:61)[un dertow-servlet-1.0.15.Final.jar:1.0.15.Final] at io.undertow.security.handlers.AuthenticationMechanismsHandler.handleRequest(AuthenticationMechanismsHandler.java:58) [undertow-core-1.0.15.Final.jar:1.0.15.Final] at io.undertow.servlet.handlers.security.CachedAuthenticatedSessionHandler.handleRequest(CachedAuthenticatedSessionHandler.java:70) [undertow-servlet-1.0.15.Final.jar:1.0.15.Final] at io.undertow.security.handlers.SecurityInitialHandler.handleRequest(SecurityInitialHandler.java:76) [undertow-core-1.0.15.Final.jar:1.0.15.Final] at io.undertow.server.handlers.PredicateHandler.handleRequest(PredicateHandler.java:25) [undertow-core-1.0.15.Final.jar:1.0.15.Final] at org.wildfly.extension.undertow.security.jacc.JACCContextIdHandler.handleRequest(JACCContextIdHandler.java:61) at io.undertow.server.handlers.PredicateHandler.handleRequest(PredicateHandler.java:25) [undertow-core-1.0.15.Final.jar:1.0.15.Final] at io.undertow.server.handlers.PredicateHandler.handleRequest(PredicateHandler
dertow-servlet-1.0.15.Final.jar:1.0.15.Final)位于io.undertow.security.handlers.AuthenticationMechanismsHandler.handleRequest(AuthenticationMechanismsHandler.java:58)[undertow-core-1.0.15.Final.jar: 1.0.15.Final]位于io.undertow.servlet.handlers.security.CachedAuthenticatedSessionHandler.handleRequest(CachedAuthenticatedSessionHandler.java:70)[undertow-servlet-1.0.15.Final.jar:1.0.15.Final]位于io.undertow .security.handlers.SecurityInitialHandler.handleRequest(SecurityInitialHandler.java:76)[undertow-core-1.0.15.Final.jar:1.0.15.Final] at io.undertow.server.handlers.PredicateHandler.handleRequest(PredicateHandler.java :25),位于io.undertow的org.wildfly.extension.undertow.security.jacc.JACCContextIdHandler.handleRequest(JACCContextIdHandler.java:61)上的[undertow-core-1.0.15.Final.jar:1.0.15.Final]。 server.handlers.PredicateHandler.handleRequest(PredicateHandler.java:25)[undertow-core-1.0.15.Final.jar:1.0.15.Final] at io.undertow.server.handlers.PredicateHandler.handleRequest(PredicateHandler .java:25) [undertow-core-1.0.15.Final.jar:1.0.15.Final] at io.undertow.servlet.handlers.ServletInitialHandler.handleFirstRequest(ServletInitialHandler.java:240) [undertow-servlet-1.0.15.Final.jar:1.0.15.Final] at io.undertow.servlet.handlers.ServletInitialHandler.dispatchRequest(ServletInitialHandler.java:227) [undertow-servlet-1.0.15.Final.jar:1.0.15.Final] at io.undertow.servlet.handlers.ServletInitialHandler.access$000(ServletInitialHandler.java:73) [undertow-servlet-1.0.15.Final.jar:1.0.15.Final] at io.undertow.servlet.handlers.ServletInitialHandler$1.handleRequest(ServletInitialHandler.java:146) [undertow-servlet-1.0.15.Final.jar:1.0.15.Final] at io.undertow.server.Connectors.executeRootHandler(Connectors.java:177) [undertow-core-1.0.15.Final.jar:1.0.15.Final] at io.undertow.server.HttpServerExchange$1.run(HttpServerExchange.java:727) [undertow-core-1.0.15.Final.jar:1.0.15.Final] at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1145) [rt.jar:1.7.0_55] a
.java:25)[io.undertow.servlet.handlers.ServletInitialHandler.handleFirstRequest(ServletInitialHandler.java:240)的[undertow-core-1.0.15.Final.jar:1.0.15.Final] [undertow-servlet-1.0。 15.Final.jar:1.0.15.Final]位于io.undertow.servlet.handlers.ServletInitialHandler.dispatchRequest(ServletInitialHandler.java:227)[undertow-servlet-1.0.15.Final.jar:1.0.15.Final]在io.undertow.servlet.handlers.ServletInitialHandler.access $ 000(ServletInitialHandler.java:73)[undertow-servlet-1.0.15.Final.jar:1.0.15.Final]在io.undertow.servlet.handlers.ServletInitialHandler $ 1 .handleRequest(ServletInitialHandler.java:146)[undertow-servlet-1.0.15.Final.jar:1.0.15.Final] at io.undertow.server.Connectors.executeRootHandler(Connectors.java:177)[undertow-core- 1.0.15.Final.jar:1.0.15.Final]位于io.undertow.server.HttpServerExchange $ 1.run(HttpServerExchange.java:727)[undertow-core-1.0.15.Final.jar:1.0.15.Final ] at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1145)[rt.jar:1.7.0_55] a t java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:615) [rt.jar:1.7.0_55] at java.lang.Thread.run(Thread.java:745) [rt.jar:1.7.0_55]
t java.util.concurrent.ThreadPoolExecutor $ Worker.run(ThreadPoolExecutor.java:615)[rt.jar:1.7.0_55]位于java.lang.Thread.run(Thread.java:745)[rt.jar:1.7。 0_55]
Update: 更新:
At Guaido79's request, my web.xml
: 应Guaido79的要求,我的
web.xml
:
<?xml version="1.0" encoding="UTF-8"?>
<web-app xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns="http://xmlns.jcp.org/xml/ns/javaee" xsi:schemaLocation="http://xmlns.jcp.org/xml/ns/javaee http://xmlns.jcp.org/xml/ns/javaee/web-app_3_1.xsd" id="WebApp_ID" version="3.1">
<display-name>seleneWar</display-name>
<welcome-file-list>
<welcome-file>index.xhtml</welcome-file>
</welcome-file-list>
<servlet>
<servlet-name>Faces Servlet</servlet-name>
<servlet-class>javax.faces.webapp.FacesServlet</servlet-class>
<load-on-startup>1</load-on-startup>
</servlet>
<servlet-mapping>
<servlet-name>Faces Servlet</servlet-name>
<url-pattern>*.xhtml</url-pattern>
</servlet-mapping>
<error-page>
<error-code>500</error-code>
<location>/error/500.xhtml</location>
</error-page>
<context-param>
<param-name>javax.faces.INTERPRET_EMPTY_STRING_SUBMITTED_VALUES_AS_NULL</param-name>
<param-value>true</param-value>
</context-param>
<context-param>
<param-name>primefaces.CLIENT_SIDE_VALIDATION</param-name>
<param-value>true</param-value>
</context-param>
<resource-ref>
<res-ref-name>jsf/ProjectStage</res-ref-name>
<res-type>java.lang.String</res-type>
</resource-ref>
</web-app>
There are two modes in that component: simple and extended mode. 该组件有两种模式:简单模式和扩展模式。
In the simple mode, you don't need to specify anything in your faces-config.xml
. 在简单模式下,您不需要在
faces-config.xml
指定任何内容。 So you can delete these lines: 因此,您可以删除以下几行:
<application>
<el-resolver>org.primefaces.application.exceptionhandler.PrimeExceptionHandlerELResolver</el-resolver>
</application>
<factory>
<exception-handler-factory>org.primefaces.application.exceptionhandler.PrimeExceptionHandlerFactory</exception-handler-factory>
</factory>
Or delete the whole faces-config.xml
file since it's the only thing you have in there. 或删除整个
faces-config.xml
文件,因为这是您唯一的文件。 Then you can test simple mode, which is working fine without defining anything else in your web.xml. 然后,您可以测试简单模式,而无需在web.xml中定义其他任何内容即可正常工作。 This might be enough for your needs .
这可能足以满足您的需求 。
From the error trace, it seems that in extended mode (with that faces-config.xml
configuration), the component needs to have an error page defined in your web.xml
. 从错误跟踪看,似乎在扩展模式下(具有
faces-config.xml
配置),该组件需要在web.xml
定义一个错误页面。 You don't want a redirection to an error page, so if you add the following code to your web.xml
for example works, but not for your needs: 您不希望重定向到错误页面,因此,例如,如果将以下代码添加到
web.xml
,例如可以工作,但不能满足您的需要:
<error-page>
<exception-type>java.lang.Throwable</exception-type>
<location>/error/500.xhtml</location>
</error-page>
Anyway, it's HIGHLY recommended to use the p:ajaxExceptionHandler
native component since it looks like the authors of PrimeFaces Extensions will probably remove the component in the future since it's no longer necessary (link) already removed the component in version 3.2.0. 无论如何,强烈建议使用
p:ajaxExceptionHandler
本机组件,因为PrimeFaces Extensions的作者以后似乎会删除该组件,因为不再需要(链接)已经在3.2.0版中删除了该组件。 (link) (链接)
How it's configured your web.xml? 如何配置您的web.xml? For me it's working with this configuration:
对我来说,它正在使用此配置:
example web.xml: 示例web.xml:
<error-page>
<exception-type>javax.faces.application.ViewExpiredException</exception-type>
<location>/pages/errorpages/sessione-scaduta.xhtml</location>
</error-page>
<error-page>
<exception-type>java.lang.Throwable</exception-type>
<location>/pages/errorpages/runtime-error.xhtml</location>
</error-page>
faces-config.xml faces-config.xml
<application>
<message-bundle>ValidationMessages</message-bundle>
<resource-bundle>
<base-name>/Bundle</base-name>
<var>bundle</var>
</resource-bundle>
<el-resolver>
org.primefaces.application.exceptionhandler.PrimeExceptionHandlerELResolver
</el-resolver>
<locale-config>
<default-locale>it</default-locale>
</locale-config>
<view-handler>it.infogroup.wrl.web.utils.PathTrimViewHandler</view-handler>
</application>
<factory>
<exception-handler-factory>
org.primefaces.application.exceptionhandler.PrimeExceptionHandlerFactory
</exception-handler-factory>
</factory>
With this configuration you will be redirected on error. 使用此配置,您将在错误时被重定向。
If you need popup you need to change the code like this (from primefaces showcase): 如果需要弹出窗口,则需要这样更改代码(从primefaces展示柜中):
<p:ajaxExceptionHandler type="java.lang.NullPointerException"
update="exceptionDialog"
onexception="PF('exceptionDialog').show();" />
<p:dialog id="exceptionDialog" header="Exception '#{pfExceptionHandler.type}' occured!" widgetVar="exceptionDialog"
height="500px">
Message: #{pfExceptionHandler.message} <br/>
StackTrace: <h:outputText value="#{pfExceptionHandler.formattedStackTrace}" escape="false" /> <br />
<p:button onclick="document.location.href = document.location.href;"
value="Reload!"
rendered="#{pfExceptionHandler.type == 'javax.faces.application.ViewExpiredException'}" />
</p:dialog>
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.