Oracle GlassFish Server Does Not Redirect to Custom Error Pages For HTTP Error Code 500 (Doc ID 1348162.1)

Last updated on NOVEMBER 05, 2016

Applies to:

Oracle GlassFish Server - Version 2.1 to 2.1.1 [Release 2.1]
Information in this document applies to any platform.
***Checked for relevance on 07-Nov-2013***

Symptoms

Oracle GlassFish Application Server can be configured to redirect to custom defined error pages when it returns HTTP Error codes, for example 404, 500 etc., rather than the default error page. This can be achieved by setting the send-error_n property for the virtual server.  Below is a example of the domain.xml file with this property set :

<virtual-server hosts="${com.sun.aas.hostName}" http-listeners="http-listener-1,http-listener-2" id="server" log-file="${com.sun.aas.instanceRoot}/logs/server.log" state="on">
<property name="docroot" value="${com.sun.aas.instanceRoot}/docroot"/>
<property name="accesslog" value="${com.sun.aas.instanceRoot}/logs/access"/>
<property name="sso-enabled" value="false"/>
<property name="send-error_1" value="path=../applications/j2ee-apps/myapp/myapp_war/404.html reason=Resource_not_found code=404"/>
</virtual-server>


However, this feature does not work in GF 2.1.1 when the HTTP status code is 500.

Cause

Sign In with your My Oracle Support account

Don't have a My Oracle Support account? Click to get started

My Oracle Support provides customers with access to over a
Million Knowledge Articles and hundreds of Community platforms