I have a custom 404.html in ../docroot/404.html
My Glassfish is configured behinde Apache via mod_jk.
Browsing to a non-existing webapp shows this page nicely.
BUT browsing to my webapp when it is not working results
in a web page showing the SOURCE CODE of my 404.html.
It appears that a HTTP header is wrong in ths particular case.