----------
From: Luc Saint-Elie lse@imaginet.fr
To: "Java Apache Users" java-apache-users@list.working-dogs.com
Subject: Re: How to debug servlets in jserv?
Date: Wed, Jul 21, 1999, 4:43 PM
I didn't try it.. but lutris (http://www.enhydra.org) just released a free
servlet debugger.. you may want to have a look at it.
Le 15:44 21/07/99 -0600, Dave King a écrit:
>I'm sure this is a FAQ question (it was on the Java Web Server Mailing
>list) and I promise to add it to the FAQ-O-Matic when I find out how.
>
>In the java web server you could run it as a console app and you'd see
>the System.out messages. Doesn't seem to work with apache on NT.
>
>log() works but I'm wondering if anyone has details on attaching a
>debugger to jserv or other debuging sugestions.
>
>I'm using JDK 1.2.1 on NT.
>
>-Peace
>Dave
+------------------------------------------------+
| Luc Saint-Elie |
| 75018 Paris France |
| Tel: 1(212)894 3713 ext: 0012 |
| email : luc@interpasnet.com |
+------------------------------------------------+
| Java Server Side Open Source technologies |
| http://www.interpasnet.com/JSS |
+------------------------------------------------+ |
----------
From: Andy John andy@Enhydra.ORG
To: java-apache-users@list.working-dogs.com
Subject: Re: How to debug servlets in jserv?
Date: Wed, Jul 21, 1999, 11:17 PM
When I needed to see stdout from my servlet, I set up JServ so that
the backend was running in a "normal" VM that I started.
In Apache's httpd.conf, set ApJServManual to "on". Now when Apache
starts up, it won't fire up a VM to run the back end. Of course,
servlets are now broken until you do it manually...
Then I wrote my own shell script to start the VM. This is on Unix,
your milage may vary. Here's what it does:
#!/bin/sh
JAVA=/usr/local/jdk1.1.7/bin/java
CLASS=org.apache.jserv.JServ
CP=/u/shawntmp/aj10/src/java/ApacheJServ.jar:/usr/local/jsdk2.0/lib/jsdk.jar
http/jserv-demo-80/EnhydraDebugger/enhydra.jar
CONF=/u/http/jserv-demo-80/conf/jserv.properties
CLASSPATH=$CP
export CLASSPATH
$JAVA $CLASS $CONF
Since you start the VM "normally", when your servlet writes to stdout, you
will see it.
There is another option.... :)
You could try the EnhydraServletDebugger!
This is a servlet that you run in addition to your problem servlet (in the
same zone). You connect to it and run the debugger (the front end is an
applet). You then connect to your own servlet through the debugger, and
it logs all the requests.
This would not show output to stdout. It does not set breakpoints, or step
through your code. It does show you all the detail of the request, the
response, the output (if html or text), and every call your servlet made
to the request/response API (including the results given to your servlet).
So, for example, you would be able to see that your serlvet is asking for
a list of all headers, and see what was given to it. Then you notice that
one of them is spelled differently than you thought. Aha!!!
We have used this kind of debugging for a year now, and it has saved us
many many hours of frustration. Your servlet must be running enough to
handle responses for it to be useful, of course.
Here is some screenshots, so you can get a feel for it:
Request details: http://www.enhydra.org/media/screenshots/SADebuggerRequest.gif
Servlet API trace: http://www.enhydra.org/media/screenshots/SADebuggerTrace.gif
Response details: http://www.enhydra.org/media/screenshots/SADebuggerResponse.gif
Here is where to download it:
http://www.enhydra.org/cuts/EnhydraServletDebugger_b1.zip
See the file README.html for installation instructions.
Hope this helps!
Andy |
I have been able to use JBuilder 3 on Windows NT to debug my servlets.
First, I downloaded JServ.java from WebCVS and added it to my project.
Next, I set JServ.java to be the default runnable file in the project properties.
Next, in the project properties I added c:\path2jerv\conf\jserv.properties to
the parameters.
Set your breakpoints, start debugging (Shift+F9), and you're off!!
Scott Sanders
scott@eionline.com |