I'm deploying my app to WildFly 8 and have attempted to configure it so that a nice 404 error page is given by adding the following into my web.xml
<error-page> <error-code>404</error-code> <location>/error.jsf</location> </error-page>
This works fine when I try to access non-JSF pages that don't exit. For example if I attempt to access a page called IDoNotExist.html, then my error page is displayed correctly.
If however, I attempt to access a JSF page that doesn't exist, e.g. IDoNotExist.jsf, then I don't get my custom error page - I just get a blank page and the following error is logged to WildFly.
WARNING [javax.enterprise.resource.webcontainer.jsf.context] (default task-8) JSF1091: No mime type could be found for file /IDoNotExist.jsp. To resolve this, add a mime-type mapping to the applications web.xml.
Note that the error log references a .JSP page whereas I attempted to acces a .JSF page.
Is there something missing from my web.xml file?
I'm fighting with the same problem. It persists on Wildfly 8.1.0-final.
Edit: According to http://stackoverflow.com/questions/22673449/404-error-pages-not-being-displayed-when-accessing-non-existent-jsf-pages-in… if you map the FacesServlet to *.xhtml it works. Unfortunately I can't do that.