Environment
NetIQ Access Manager 4.0
NetIQ Access Manager 4.1
NetIQ Access Manager 4.2
NetIQ Access Manager 4.1
NetIQ Access Manager 4.2
Situation
- Howto disable returning Java Execption Stack Traces to users
Resolution
The tomcat "web.xml" application deployment file offers the option to take an action on how to handle error situations by making us of the <error-page> configuration directive. The following configuration will take care of internal 500 Server errors and Java Exceptions
Example:
<error-page>
<error-code>500</error-code>
<location>/error.html</location>
</error-page>
<error-page>
<exception-type>java.lang.Throwable</exception-type>
<location>/error.html</location>
</error-page>
<error-page>
<exception-type>java.lang.NullPointerException</exception-type>
<location>/error.html</location>
</error-page>
With this configuration instead of returning a internal 500 Server errors or Java Exceptions the content of the "error.html" will be returned.
Note: The way you design your "error.html" is out of the scope for this TID
Example:
<error-page>
<error-code>500</error-code>
<location>/error.html</location>
</error-page>
<error-page>
<exception-type>java.lang.Throwable</exception-type>
<location>/error.html</location>
</error-page>
<error-page>
<exception-type>java.lang.NullPointerException</exception-type>
<location>/error.html</location>
</error-page>
With this configuration instead of returning a internal 500 Server errors or Java Exceptions the content of the "error.html" will be returned.
Note: The way you design your "error.html" is out of the scope for this TID
Additional Information
- Document root for pages is the "WEB-INF" directory for the given application
- Location of NetIQ Access Manager "web.xml" files by service:
- Admin Console and REST API: "/opt/novell/nam/adminconsole/webapps/adminui/WEB-INF/web.xml"
- NIDP server: "/opt/novell/nids/lib/webapp/WEB-INF/web.xml"
- Embedded Service Provider: "/opt/novell/nesp/lib/webapp/WEB-INF/web.xml"