Previous     Contents     Index     Next     
iPlanet Web Server, FastTrack Edition Programmer's Guide to Servlets



Appendix E   Debugging Servlets and JSPs


This appendix gives guidelines for debugging servlets and JSPs in iPlanet Web Server 4.1.



Servlet Debugging



iPlanet Web Server 4.1 ships with the Java Runtime Environment (JRE) but not the Java Development Kit (JDK) due to licensing restrictions. However, during installation, you can select an option that tells the server to use a JDK if there is one installed elsewhere on your system.

If the server has been instructed to use a JDK, you can do remote servlet debugging. If the server is using the JRE, you need to switch it to using the JDK before you can do remote debugging. For information on instructing the server to use the JDK or the JRE, see the section "Configuring JRE/JDK Paths."

Assuming that the server is using the JDK, you can enable remote debugging by following these steps:

  1. Set the following parameters in jvm12.conf as appropriate:

    jvm.enableDebug=1
    java.compiler=NONE

  2. To send exceptions to the client in addition to the log file, set the following parameter. If the client is a browser, exceptions are displayed in the browser.

    jvm.trace=7

  3. On some platforms, you may be required to specify the bootclasspath. For example, for Solaris platforms, if Java 1.2 is in /java, you set it as:

    jvm.option=-Xbootclasspath:/java/lib/tools.jar:/java/jre/lib/rt.jar

  4. Start the server manually and record the password for remote debugging (this is displayed on the console).

  5. Start the Java debugger:

    jdb -host your_host -password the_password

You should be able to debug your Java classes now using the jdb command.



JSP Debugging



iPlanet Web Server 4.1 uses a public domain JSP compiler developed as part of Apache Software Foundation's Jakarta project. The Jakarta project develops a servlet engine called Tomcat, which includes a JSP compiler called Jasper. The version of the JSP compiler is taken from the Tomcat 3.0 Milestone release. Subsequent versions of iPlanet Web Server will use later versions of the Jasper JSP compiler. For more information, see the following web site:

http://jakarta.apache.org/

iPlanet Web Server 4.1 uses a native servlet engine, but uses the Jasper JSP compiler for compiling a JSP page into a servlet. Jasper and iPlanet Web Server 4.1 are not tightly integrated, so you might need to edit the JVM Classpath (in the Configure JVM Attributes page of the Server Manager or in the jvm12.conf file) when deploying JSPs using Tag Libraries, beans, and so on.

For information about how to enable JSPs, see "Activating Servlets and JSP."

You can debug your JSPs by following these steps:

  1. Set the following parameters in jvm12.conf as appropriate:

    java.compiler=NONE
    jvm.trace=6
    nes.jsp.enabledebug=1

  2. To send exceptions to the client in addition to the log file, set the following parameter. If the client is a browser, exceptions are displayed in the browser.

    jvm.trace=7

Setting java.compiler=NONE includes line numbers of the Java source code in the verbose output of the log files. Setting jvm.trace=6 or jvm.trace=7 enables verbose output from the JSP compiler and the servlet engine. Setting nes.jsp.enabledebug=1 makes iPlanet Web Server 4.1 generate debuggable Java servlets from the JSPs.


Previous     Contents     Index     Next     
Copyright © 2000 Sun Microsystems, Inc. Some preexisting portions Copyright © 2000 Netscape Communications Corp. All rights reserved.

Last Updated July 13, 2000