Custom Error Messages in the Portal
The purpose of this Blog is to provide the information about the Configuration of Custom Error Message of the following error pages.
1. ‘Dispatcher Connected Server not Running’ error page.
2. ‘Application Stopped’ error page.
3. ‘HTML error Messages’ such as 404,403,500 error pages.
4. KM Error Pages
h3. 1. Customizing ‘Dispatcher Connected Server not Running’ error message.
Error Condition:
The dispatcher is started and able to receive client requests but there is no server attached to it to process the requests.
Customizing Steps:
The following customizing steps are to be done for every instance of the Portal.
a. Create a folder called “errormessage” in the below directory.
/usr/sap/<SID>/<instance>/j2ee/cluster/dispatcher/
b. Creat your own custom HTML error page ‘serverdown.html’.
Keep serverdown.html page under this location.
Error Page Location:/usr/sap/<SID>/<instance>/j2ee/cluster/dispatcher/errormessage/serverdown.html
c. Set the following property in Visual Administrator.
+ServiceUnavailableResponse += ./errormessage/serverdown.html
Navigate to Cluster-> Server -> Services -> HTTP Provider
Use the S+erviceUnavailableResponse +property of the HTTP Provider Service on the dispatcher to specify the path to your error page.
d. Restart the j2ee instance.
Now serverdown.html will be shown when the dispatcher is started but there is no server attached to it .
h3. 2. Customizing ‘Application Stopped’ error message.
Error Condition:
The Portal application that you have requested is stopped at the moment.
Customizing Steps:
The following customizing steps are to be done for every instance of the Portal.
a. Create a folder called “errormessage” in the below directory.
/usr/sap/<SID>/<instance>/j2ee/cluster/dispatcher/
b. Creat your own custom HTML error page ‘appdown.html’.
Keep appdown.html page under this location.
Error Page Location:/usr/sap/<SID>/<instance>/j2ee/cluster/dispatcher/errormessage/appdown.html
c. Set the following property in Visual Administrator.
+ApplicationStoppedFile += ./errormessage/serverdown.html
Navigate to Cluster-> Server -> Services -> Web Container
Use the ServiceUnavailableResponse property of the HTTP Provider Service on the dispatcher to specify the path to your error page.
d. Restart the j2ee instance.
Now appdown.html will be shown when the Portal application that you have requested is stopped.
3. Customizing HTML error Messages such as 404,403,500 error pages.
Error Condition:
The Portal page that you have requested is giving a standard HTML error meaage such as 404,403,500 etc.
Note: Using this Customization we cannot change 400 error message.
Customizing Steps:
The following customizing steps are to be done for every instance of the Portal.
a. Create a folder called “customerrors” in the below directory.
/usr/sap/<SystemID>/<InstanceID>/j2ee/cluster/<ServerNode>/apps/sap.com/irj/servlet_jsp/irj/root/
b. Creat your own custom HTML error page ‘403.html’,’403.html’,’403.html’,’404.html’,’408.html and ”500.html’.
Keep the custom HTML pages under this location.
Error Page Location: /usr/sap/<SystemID>/<InstanceID>/j2ee/cluster/<ServerNode>/apps/sap.com/irj/servlet_jsp/irj/root/customerrors
c. Navigate to: /usr/sap/<SystemID>/<InstanceID>/j2ee/cluster/server0/apps/sap.com/irj/servlet_jsp/irj/root/web-inf</p><p style=”margin: 3pt 0cm” class=”tableheading”> </p><p style=”margin: 3pt 0cm” class=”tableheading”>Edit web.xml file found in the above location to add the below XML snippet</p><p style=”margin: 3pt 0cm” class=”tableheading”> </p><p style=”margin: 3pt 0cm” class=”tableheading”>+ <error-page><br /> <error-code>403</error-code><br /> <location>/customerrors/403.html</location><br /> </error-page><br /> <error-page><br /> <error-code>404</error-code><br /> <location>/customerrors/404.html</location><br /> </error-page><br /> <error-page><br /> <error-code>408</error-code><br /> <location>/customerrors/408.html</location><br /> </error-page><br /> <error-page><br /> <error-code>500</error-code><br /> <location>/customerrors/500.html</location><br /> </error-page><br /> </p><p style=”margin: 3pt 0cm” class=”tableheading”> </p><p style=”margin: 3pt 0cm” class=”tableheading”> d. Restart the j2ee instance.<br /> </p><p style=”margin: 3pt 0cm” class=”tableheading”> </p><p style=”margin: 3pt 0cm” class=”tableheading”>Now in case of any html error such as 403, 404, 408 or 500 your custom error html pages will be displayed by the portal.</p><p style=”margin: 3pt 0cm” class=”tableheading”> </p><p style=”margin: 3pt 0cm” class=”tableheading”>Note:</p><ul><li>In case if you want to change the error messages for a specific application, then copy the “customerrors”+ folder inside /servlet_jsp of the application component folder as the deployment descriptor file, web.xml is specific to an application.
4. Customizing KM error messages.
Error Condition:
You can modify the standard KM error pages that are displayed when an error occurs.
Customizing Steps:
a. Create an HTML page 403.html, 404.html 408.html and nonavfound.html with the required error message.
b. create a folder under any directory in the server.
eg: /etc/error_pages
c. Login the portal as Adminitrator.
Choose System Administration ->System Configuration -> Knowledge Management -> Content Management ->Web Page Composer ->Error Pages ->Error Pages .
d. Select the required error page and choose Edit.
e. In the RID of Error Page parameter, enter the path to the HTML file that you want to be displayed if an error occurs.
Example: +/etc/error_pages/nonavfound.html +
d. Save the changes
Now in case of any KM error such as 403, 404, 408 or 500 your custom error html pages will be displayed by the portal.
Additional Reference:
Please refer to the below documentations in case you find any difficulties following the steps specified in the blog.
SAP Notes –
-
Note 795699 – Customizing default error messages for HTTP.
-
Note 1113811 – Web Dynpro error page, known error situations, error codes
-
Note 962319 – Detailed error messages with stack trace in Web Dynpro.
SAP HELP –
-
[Custom Error Pages | http://help.sap.com/saphelp_nw70/helpdata/EN/47/1d5a4390524403e10000000a1553f6/frameset.htm]
-
[Modifying KM Error Pages | http://help.sap.com/saphelp_nw70/helpdata/EN/47/1d5a4390524403e10000000a1553f6/frameset.htm]
SDN Blogs –
[Custom Error Messages Using SAP Web Dispatcher | Custom Error Messages Using SAP Web Dispatcher]
You could have included steps of webdispatcher :
http://help.sap.com/saphelp_nw70/helpdata/EN/b4/85cd17dbc04f5c8d5069e0215
But still nice Blogs...!!!
Thanks for the feedback. Also your point is noted; I will include the web dispatcher error message customization.
Thanks a lot, this is quite useful.
However i have one query, when you mentioned that
Set the following property in Visual Administrator.
ServiceUnavailableResponse = ./errormessage/serverdown.html
May I know where I should do this?
Hi Hussain,
Any idea how to acheive step 3 i.e. custom error messages in SAP NW 7.3.
Regards,
Navya
Hi Team,
Is it possible to customize this"Highlighted with bold" message and display a more user friendly message on the portal.
For example below mentioned standard error message to our own custom message.
System Error
An exception occurred during the program execution.
Exception Message: Connection Failed: Connection setup failedConnection Failed: A nested exception occurred. Could not initialize physical connection
Please guide me to customize this standard message to our own message to display in SAP Portal.Is there any file available to modify for this error message provide me path to customize.
Thanks and Regards,
Shaik