Debugging a Servlet
This section presents some generic, basic advice on how to debug a servlet running in the servlet container. It assumes you already know how to use the debugger for your compiler.
Here are some general principals:
*Your servlet library must, of course, have been built with debugging options.
*You cannot place a breakpoint in your servlet library until after it has been loaded into the container process.
Here is the procedure for debugging a servlet:
1. Prepare for debugging by either
*starting the container and then attaching the debugger to the container process
*starting the container in the debugger
2. Verify that the servlet library has been loaded into the container.
There are a number of ways to verify that the servlet library has been loaded, such as by checking the rwagent.log file or by checking the debugger output.
3. Pause execution of the container process so a breakpoint can be set.
4. Set a break point in the servlet source code.
5. Outside the debugger, execute a client that sends a request to the servlet.
6. When the servlet hits the break point, start your debugging.