Contrary to other servers (Tomcat, JBoss AS 7/EAP 6, GlassFish and
probably all others), Undertow immediately performs a forward when
HttpServletResponse#sendError() is invoked instead of waiting until
all servlets and filters of the application are finished.
In case the error page happens to be a Facelets page, this forward
causes the FacesServlet to be invoked once again, basically creating
another FacesContext inside the same thread. This overrides the
previous FacesContext. After that is released, the "original"
FacesContext is never put back.
In OmniFaces we created a workaround for this, see
Unfortunately, this OmniFaces workaround isn't bulletproof. In case of
an HTTP 400, PrimeFaces loses its RequestContext as well and OmniFaces
can't help setting it back.
This results in exceptions like the following:
Although not confirmed, this behaviour from Undertow is the likely
cause of a large number of other exceptions as well.