1

I get connection refused when remotely debugging a Java application that executes on a different server. The JVM is version 16, and the OS is Ubuntu 21.04. I chose 8999 as an unused port on the server. Not much help from Oracle documentation on runjdwp.

The command line options are ...

-Xdebug \
-Xrunjdwp:transport=dt_socket,address=8999,server=y,suspend=y \
Stephen Reed
  • 137
  • 7
  • 1
    Does this answer your question? [Remote debugging: No connection to Wildfly 14 on OpenJDK 11 at port 8787](https://stackoverflow.com/questions/53198798/remote-debugging-no-connection-to-wildfly-14-on-openjdk-11-at-port-8787) – tgdavies Sep 21 '21 at 21:08
  • Yes, the answer to your linked question also answers my question. The answer specifies *: where I used IPv4 0.0.0.0:. – Stephen Reed Sep 22 '21 at 23:59

1 Answers1

5

The socket 8999 on the remote host defaults to 127.0.0.1:8999 which only accepts connections from running on the same host. In order to accept connections from any host, I found that the following worked OK.

-Xdebug \
-Xrunjdwp:transport=dt_socket,address=0.0.0.0:8999,server=y,suspend=y \
Stephen Reed
  • 137
  • 7