Friday, March 20, 2009

ErrorDocument not working for Oracle HTTP Server with OC4J

When an application is deployed in an OC4J container sometimes ugly error messages are thrown in the browser (401 Unauthorised). Normally these messages can be formatted in $ORACLE_HOME/Apache/Apache/conf/httpd.conf with the ErrorDocument feature. But there is a bug in Oracle HTTP Server. This can be solved by adding the following line in $ORACLE_HOME/Apache/Apache/conf/mod_oc4j.conf


<IfModule mod_oc4j.c>
Oc4jUseOHSErrors on
</IfModule>


And in httpd.conf:


ErrorDocument 401 "You are not authorised to view this page.


Metalink note: 560358.1

2 comments:

  1. Excellent .. Saved a lot of frustration ...

    Great useful post.

    Sujith Jacob Mathew

    ReplyDelete
  2. awesome post, thanks, you saved my day!!

    ReplyDelete

comment