This discussion is archived
2 Replies Latest reply: Apr 30, 2008 1:52 PM by 800575 RSS

running JPDA on several VMs

529432 Newbie
Currently Being Moderated
i read that you could connect to several VM's running JPDA at the same time. I think this is rather a dumb question, but I just want to confirm, as I'm a newbie to the JPDA . . . I guess each VM would have to ahve it's own port number for the server side debugger stuff? Is this right?
  • 1. Re: running JPDA on several VMs
    800575 Newbie
    Currently Being Moderated
    Actually, this is not a dumb question at all. JPDA supports two modes of operation:
    - the debugger listens for incoming connections from debuggees. In this case,
    the debugger would use a JDI ListeningConnector and the debuggee would be
    run with options such as

    - a debuggee listens for incoming connection from a debugger.

    For example,
    For more info, see:
    http://java.sun.com/javase/6/docs/technotes/guides/jpda/conninv.html
  • 2. Re: running JPDA on several VMs
    800575 Newbie
    Currently Being Moderated
    Oops - that last post ended prematurely due to this wiki editor not understanding xemacs key bindings :-)
    As I was saying before I was rudely interrupted...

    Actually, this is not a dumb question at all. JPDA supports two modes of operation:

    a- a debugger listens for incoming connections from debuggees
    In this case, the debugger will use a JDI ListeningConnector to listen for incoming connections at
    some transport address, say xxx, and the debuggees will be started with options such as
    -agentlib=jdwp:transport=dt_socket,address=xxx,server=n,... ...


    b- a debuggee listens for an incoming connection from a debugger.
    In this case, the debuggee is started in 'server mode':
    -agentlib=jdwp:transport=dt_socket,address=xxx,server=y,... ...

    And the debugger uses a JDI AttachingConnector to attach to address xxx.
    See http://java.sun.com/javase/6/docs/technotes/guides/jpda/conninv.html
    for more info.

    Now, on to your question at last :-)
    Some transports support mulitple connections as specified in the above
    doc page. In the current JDK from Sun, only the socket transport does so.
    This means that if you use the socket transport then if you use method a-
    shown above, then multiple debuggees could connect to your debugger,
    all using the same address, xxx.

    However, if you use method b- above where the debuggee is the transport 'server',
    then you are correct that each debuggee needs a separate transport address at
    which to listen for connections from debuggers.

    HTH