Skip to main content



      Home
Home » Language IDEs » Java Development Tools (JDT) » How to debug client server processes on local eclipse environement
How to debug client server processes on local eclipse environement [message #180568] Thu, 30 September 2004 18:45 Go to next message
Eclipse UserFriend
Originally posted by: devon.eversmile.com

My project's Eclipse (ant build compiles and launches 1 server process
with 2 client proceses all from the same build.xml on the local machine.

I use Eclipse v2.1 currently but I could upgrade to 3.x.

What is the correct practice for debugging specific processes?

Looking at the documentation for the Debug environment and some of the
discussions, this seems to imply you would only do client/server
debugging using the connection to remote server. But it is perfectly
reasonable to expect many of you have applications that are structured
like this and you must have dealt with this problem.

My current plan of attack has not worked out so well. It is to turn on
verbose ANT build messages and attempt to capture the full command line
for each client and server process, then put them into the Run->Debug...
area.

Challenges with my work-around:

1) How do I get them all to launch simultaneously or without creating
multiple instances of the Eclipse application (which is not possible due
to file locks)

2) Duplicating the exact run environment by pasting ant build command
line arguments is tedious, error-prone and must be tinkered with every
time you change the ant target options.

Am I missing any other great solutions here? Is there anything in the
works? Is this in part what the Ant Debugger that is in development is
addressing?

Thanks,
Devon
Re: How to debug client server processes on local eclipse environement [message #180709 is a reply to message #180568] Fri, 01 October 2004 11:49 Go to previous message
Eclipse UserFriend
Originally posted by: eclipse.rizzoweb.com

thermight wrote:
> My project's Eclipse (ant build compiles and launches 1 server process
> with 2 client proceses all from the same build.xml on the local machine.
>
> I use Eclipse v2.1 currently but I could upgrade to 3.x.
>
> What is the correct practice for debugging specific processes?
>
> Looking at the documentation for the Debug environment and some of the
> discussions, this seems to imply you would only do client/server
> debugging using the connection to remote server. But it is perfectly
> reasonable to expect many of you have applications that are structured
> like this and you must have dealt with this problem.
>
> My current plan of attack has not worked out so well. It is to turn on
> verbose ANT build messages and attempt to capture the full command line
> for each client and server process, then put them into the Run->Debug...
> area.
>
> Challenges with my work-around:
>
> 1) How do I get them all to launch simultaneously or without creating
> multiple instances of the Eclipse application (which is not possible due
> to file locks)
>
> 2) Duplicating the exact run environment by pasting ant build command
> line arguments is tedious, error-prone and must be tinkered with every
> time you change the ant target options.
>
> Am I missing any other great solutions here? Is there anything in the
> works? Is this in part what the Ant Debugger that is in development is
> addressing?

If I understand correctly, there are a couple of options for you. One
lets you keep launching your apps with the Ant script, the other
migrates you to launching your apps from within Eclipse.

A) You can easily attach the Eclipse debugger to any running Java
process, local or remote. All that is required of the process that you
want to debug is that it be launched with appropriate VM arguments and
properties to enable debug mode. A VM thus launched can be attached to
by any debugger (such as Eclipse) that speaks the JPDA standard
(http://java.sun.com/products/jpda). The Eclipse help and tutorials have
details on how to attach to such a running process.
So with this option, you would just modify your Ant script to launch the
process) VM(s) in debug mode, then once they are running attach to
whichever one(s) you need to debug in the Eclipse debugger.

B) Another choice is to create Eclipse Launch Configurations for each of
the processes, based on how they are launched from the Ant script. This
takes a little bit of effort (usually not too much), but once you have
it working you can launch the applications (independently of each other)
via a button click in Eclipse. It is trivial to launch them in debug
mode or in regular run mode - just depends on which button you use to
launch.
The key is usually getting the launch (runtime) classpaths set correctly
to include everything that your process need - but that should be
readily apparent by looking at the Ant script.

Option B is how I usually do it, unless the setup/environment for the
process is very complicated or has some weird/special stuff that makes
it prohibitive to create an Eclipse launch configuration for it.

I've left out the details - just wanted to explain the two basic
approaches and let you do some research/experimenting. Of course
detailed questions are always welcome on these groups - if you pick one
of these and have specific problems that the help/tutorials can't solve,
feel free to post again.

HTH,
Eric
Previous Topic:Hover Background Color
Next Topic:File Deleted error, after use AST.JLS2 APIs
Goto Forum:
  


Current Time: Sun Jul 27 12:48:49 EDT 2025

Powered by FUDForum. Page generated in 0.03885 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software

Back to the top