Sun Java System Web Server 7.0 Update 4 Developer's Guide to Java Web Applications

Generating a Stack Trace for Debugging

For information about how to generate a Java stack trace for debugging, see

http://developer.java.sun.com/developer/technicalArticles/Programming/Stacktrace/.

If the -Xrs flag is set for reduced signal usage in the server.xml file (under jvm), comment it out before generating the stack trace. If the -Xrs flag is used, the server might dump core and restart when you send the signal to generate the trace.

The stack trace goes to the system log file or to stderr based on the log attributes in server.xml.

For more information about the server.xml file, see the Sun Java System Web Server 7.0 Update 4 Administrator’s Guide.

Displaying Stack Trace and Compiler Errors

Web Server supports, display-exception feature under server/servlet container which displays stack traces and compiler errors to the browser. This feature helps the user to view the log in the browser and prevents them from looking into the server log file every time a compiler error occurs. You can enable or disable this feature by set-servlet-container-prop CLI or by selecting Display-Exception check box under set-servlet-container tab in Administration GUI.

ProcedureTo Display Stack Trace and Compiler Error

  1. Create a JSP with syntax error.

  2. Request for the log page through the browser.

    The browser displays the message Server Error.

  3. Select Display-Exception check box under set-servlet-container tab in Administration GUI or enable the display-exception feature through set-servlet-container-prop CLI.

  4. Request for the log page again through the browser.

    The browser displays the stack trace and compiler errors.