Search code examples
javadebuggingremote-debugging

Application prints "Listening for transport dt_socket at address: 5005" and does not halt


I start code execution with the typical arguments:

java -Xdebug -Xrunjdwp:transport=dt_socket,server=y,suspend=n,address=5005 myPackage.myMainClassname

Application starts, prints "Listening for transport dt_socket at address: 5005" and... goes further! Without any attempt to wait for connection. I CAN connect to it during execution and debugging itself works. But why does the application not wait for connection from debugger?

Looks like something is broken in my configuration, but I cannot figure out the root cause. I tried several ways to specify debug settings, different ports, run as administrator, turn off firewalls - nothing helps.


Solution

  • You need to specify suspend=y if you want it to wait for connection. Your debugging is working. If you try to connect you will be able to. Most probably you are just used to using suspend=y which blocks until the connection is established.

    The behavior is expected when suspend=n.