1

I am getting the following message when I try to remote debug a java application through eclipse. "Failed to connect to remote VM. Connection refused." What could be the error?

softwarematter
  • 28,015
  • 64
  • 169
  • 263

5 Answers5

3

You need to invoke the process to be debugged with the appropriate options e.g.

-Xdebug -Xrunjdwp:transport=dt_socket,server=y,suspend=n,address=1044

(substitute with the appropriate port if necessary) and it sounds like the VM isn't listening on the configured port. You can use netstat /a to confirm if the VM is listening on that port (or telnet)

Brian Agnew
  • 268,207
  • 37
  • 334
  • 440
  • When I tried netstat /a i got: TCP DEV-MACHINE2:8787 localhost:1261 ESTABLISHED This is the only entry for the port number 8787 which I an using. – softwarematter Nov 10 '09 at 18:38
2

For client debugging, I came across the same issue

URL -agentlib:jdwp=transport=dt_socket,server=y,suspend=n,address=4081

Changing the port number solved the issue.

oers
  • 18,436
  • 13
  • 66
  • 75
1

do you have port 8000, or whatever port you have configured for remote connections open on your firewall?

z -
  • 7,130
  • 3
  • 40
  • 68
1

The remote application needs to be started first. Did you add the arguments to the target remote app so it will accept a debugging connection/

Kelly S. French
  • 12,198
  • 10
  • 63
  • 93
  • Sometimes the port hasn't been released from the last time it was ran. On Windows do a 'netstat -a' and look for the port the remote app is using to listen for debug connections. If it is still open, you won't be able to open a remote debug session. Close the port/socket or if it comes down to it, change the port used. Hopefully the first socket eventually releases before you lock up the second. – Kelly S. French Nov 11 '09 at 15:35
1

Make sure your JVM was started with these options

-Xdebug -Xrunjdwp:transport=dt_socket,address=8000,server=y,suspend=n

and that port 8000 is free

Murali VP
  • 6,198
  • 4
  • 28
  • 36