I have a complicated application with several different JVMs.
JVM 1 does about 5 minutes of work and then fires off another JVM2 to do some extra work.
I want to Debug JVM2. So I turn on a remote socket debugger on JVM2's startup script:
-Xdebug -Xrunjdwp:transport=dt_socket,server=y,suspend=n,address=8000
And I set up my Eclipse Remote Debug Session like this:
Connection Type: Standard (Socket Attach), Host: localhost, Port: 8000
If I wait for JVM2 to start, then launch the debugger, it works fine.
However it is REALLY hard to pay enough attention to click the debugger after 5 long minutes of waiting.
If I launch the remote debugger before JVM2 is on... I get
Failed to connect to remote VM. Connection refused.
Connection refused: connect
Is there someway to have the Remote Debugger continuously try to connect?
I tried to use the Eclipse Remote Debug Connection Type: Socket Listen
but this blocks the port and JVM2 gives this error on startup:
FATAL ERROR in native method: JDWP No transports initialized, jvmtiError=JVMTI_ERROR_INTERNAL(113)
ERROR: transport error 202: bind failed: Address already in use ["transport.c",L41]
ERROR: JDWP Transport dt_socket failed to initialize, TRANSPORT_INIT(510) ["debugInit.c",L500]
JDWP exit error JVMTI_ERROR_INTERNAL(113): No transports initialized
How can I have the remote debugger try over and over and over again?
suspend=y
option to have the remote JVM pause until the debugger connects. The remote JVM will not initiate an outgoing JDWP connection. – Jim Garrisonserver=n
in the-Xrunjdwp
switch and have the debugee connect as a client to the debugger server, per your second setup ("Socket Listen") in eclipse? – clstrfsck