Here is one solution.
1) Create a "root" deployment.
There already is one in catalina/webapps/ROOT
2) Add the error page
In that folder create error.html
3) in WEB-INF/web-xml add the line
Choose error codes to suite. With the root context present you will now get 404 instead of 500 for
In the folder
jar cf .war *
this is a trick (no prefix means it is deployed as "/")
Copy .war into jboss/deploy
You should now have the jakarta example page and a 404
NOTE: If you deploy something else e.g.
tomcat-test.ear it will not use the error page,
it has its own web.xml