I am able to debug my servlets with my JBuilder debugger. The trick is
to debug the whole servlet engine process, but set breakpoints in your
own code. I have made a helper class HttpServerRunner tahrt looks like
this:
public class HttpServerRunner {
public static void main(String args[]) {
sun.servlet.http.HttpServer.main(args);
}
}
I select HttpServerRunner as "runnable file", i.e. the file the
debugger starts digging in to. HttpServer.main() will in turn call my
servlets, and the debugger will stop at my breakpoints. This is
explained in detail for JBuilder 2 here:
http://home.columbus.rr.com/ggeoffre/java/servlets/debug_jbuilder2.htm
sun.servlet.http.HttpServer is a simple servlet-only web server
included in JSDK 2.0. I haven't tried JSDK 2.1, but I've heard the web
server has become more sophisticated, so the class name may have
changed as well. According to the JRun demo at JavaOne it is possible
to use JRun directly in the debugger. I think the used the same
technique, but substituted sun.servlet.http.HttpServer.main(args) with
a call to a JRun method. If JRun runs in the same VM this should work
if you know the right class and method name - does anyone know what to
use? If JRun runs on a different VM there obviously must be a bit more
magic to it. Has anyone succeeded in remote debugging of servlets?
Thomas Oldervoll
___________________________________________________________________________
To unsubscribe, send email to [EMAIL PROTECTED] and include in the body
of the message "signoff SERVLET-INTEREST".
Archives: http://archives.java.sun.com/archives/servlet-interest.html
Resources: http://java.sun.com/products/servlet/external-resources.html
LISTSERV Help: http://www.lsoft.com/manuals/user/user.html