NonStop Servlets for JavaServer Pages (NSJSP) 6.1 System Administrator's Guide

NonStop Servlets for JavaServer Pages (NSJSP) 6.1 System Administrator’s Guide596210-006
6-1
6 Debugging NSJSP
This chapter discusses the various ways of debugging applications deployed in
NSJSP. Debugging using Java Debugger tool and Eclipse platform have been
described elaborately in this chapter.
This chapter discusses the following topics:
Debugging using Java Debugger tool
Debugging using Eclipse platform
Debugging using Java Debugger tool
Use the jdb command to start the Java Debugger tool and communicate with the web
application to be debugged. You need to add jdb debugging parameters in the
servlet.config file in <NSJSP_HOME>/conf directory. This can be performed in
the following two ways:
1. Connecting to a specified port number
This is achieved by adding arguments in the Arglist of the servlet.config
file in <NSJSP_HOME>/conf directory as shown:
-Xdebug -Xnoagent -Djava.compiler=none
-Xrunjdwp:server=y,transport=dt_socket,suspend=n,
address=<debug-port>
Set Numstatic value to 1
Attach the Java Virtual Machine to the Java Debugger (jdb) using the following
command:
jdb -attach <debug-port>
2. Using process attaching connector
This is achieved by adding arguments in the Arglist of the servlet.config
file in <NSJSP_HOME>/conf directory as shown:
-Xdebug -Xnoagent -Djava.compiler=none
-Xrunjdwp:server=y,transport=dt_socket,suspend=n
This connector is uniquely identified as com.sun.jdi.ProcessAttach.
Any NSJSP process can be connected using this jdb's ProcessAttach
as given below:
jdb -connect com.sun.jdi.ProcessAttach:pid=<oss_pid>
For example:
jdb -connect com.sun.jdi.ProcessAttach:pid=218431829
where,