At 11:54 AM 3/2/00 -0500, you wrote:
>Hey all,
>
>I'm looking into ways to program/debug servlets with JDE. Right now my best
>idea is to use the
>Java Server Web Development Kit (JSWDK) which includes a servlet engine for
>testing and debugging
>and figure out some way to get JDE to use that. Perhaps we can start the
>servlet engine when we
>select "Run App" or "Debug App" -- it would put the necessary classes into
>the proper directories
>and perform whatever voodoo is necessary to get it started.
>
>The trick, though, is figuring out how to attach to the running servlet
>process and attaching JDEbug
>to it so we can step through code just like a regular app or applet. Does
>anyone have any thoughts
>how best to accomplish this?
>
Hi Ben,
JDEbug can attach to any process that is started with the appropriate
command line arguments. They are documented in the JPDA doc.
-Xdebug
(Tells process to be prepared to be debugged.)
-Xnoagent
(Tells the process that the debugger is not jdb)
-Djava.compiler=NONE
(Tells the process not to JIT compile. Not needed for JDK 1.3.)
-Xrunjdwp:transport=TRANSPORT,address=ADDRESS,server=y,suspend=n
(Tells the process the protocol for connecting to a debugger.
TRANSPORT is either dt_shmem or dt_socket. ADDRESS is an arbitrary
string for dt_shmem or a port number for dt_socket. server=y says
the debuggee process should be the "server" and the debugger the
"client" in this interaction. suspend=n says the debuggee process
should not halt after being attached to the debugger.
Thus, you can use the JDE to start the servlet engine with the above
arguments. To do this, create a project file for the servelet engine,
customize jde-run-vm-args to include the above args, then save the
customization in the project file. Now, when you start the servlet engine
via JDE->Run App, the engine will start expecting to be debugged. Next
start the debugger and execute JDEbug->Processes->Attach. JDEBug will
prompt you to enter an address. Enter the address you used to start the
servelet engine. JDEbug will then attach to the engine.
There is another way to do this, which is to debug in debugger listen mode.
This is the converse of debugger attach mode. In listen mode the debugger
listens for a process needing debugger services. You then start the
debuggee process, e.g., the servelet engine, with the appropriate command
line switches and it immediately attaches to the debugger and halts before
entering the main method. The way to do this is described in the
ReleaseNotes.txt file that comes with the JDE.
- Paul
------------------------------------------------------------
JDE mailing list archive:
http://www.mail-archive.com/[email protected]/maillist.html
If you have a problem with the JDE, please use JDE->Help->Submit Problem
Report to prepare your query. This will insure that you include all
information that may be required to solve your problem.