Sunday, July 22, 2007

Enable the exception and stack trace in the OAS 10g 10.1.3

In previous releases of OC4J, the default behavior when an error occurred in a Web application was to display both the exception and the stack trace in the HTML error page returned to the client.

This default behavior has changed in the oracle application server 10g 10.1.3 and these details are no longer displayed by default; instead, a generic error message is displayed in the HTML error page. The exception and stack trace details are sent to the log file of the relevant application.

If you have tests that rely on the display of an exception or stack trace, you can cause the stack trace to be displayed by running the application in developer mode. To run an application in development mode, set the development attribute of the <orion-web-app> element to "true" in the orion-web.xml file. Here is an example:
<?xml version="1.0"?>
<orion-web-app ... jsp-cache-directory="./persistence"
jsp-cache-tlds="standard"
temporary-directory="./temp"
context-root="/DevelopmentThrowException"
schema-major-version="10"
schema-minor-version="0"
development="true">
...
<web-app>
</web-app>
</orion-web-app>

To enable exception and stack track in oracle application server, you need to edit the orion-web.xml in the directory mentioned below once the web application is deployed into OAS 10g 10.1.3.

1.0 Find the orion-web.xml file from directory of <oracle_app_server_home>/j2ee/application-deployments/<instance_name>/<web_application__ear_file_name>/<web_application_war_file_name>/orion-web.xml

2.0 Modify the entry of orion-web-app like:

<orion-web-app
...
development="true"
>
...
</orion-web-app>

Set the development attribute of the <orion-web-app> element to "true".

3.0 Restart the app server and remember that whenever you undeploy and redeploy the same web application, you need to redo this.

Here, i would like to thanks thiam hwa, who has pointed me to the right place of the solution, for his help.

Additional resources:

Oracle Containers for J2EE – Frequently Asked Questions

Exception and Stack Trace No Longer Displayed in HTML Error Page

No comments:

´