Enabling jdwp on a jdk 14 app results in Address family not supported by protocol error

3.1k views Asked by At

For a JDK 14 application, running on linux, adding the following JVM parameter

-agentlib:jdwp=transport=dt_socket,server=y,suspend=n,address=*:5005

results in the following error

Starting Main...
ERROR: transport error 202: socket creation failed: Address family not supported by protocol
ERROR: JDWP Transport dt_socket failed to initialize, TRANSPORT_INIT(510)
JDWP exit error AGENT_ERROR_TRANSPORT_INIT(197): No transports initialized [open/src/jdk.jdwp.agent/share/native/libjdwp/debugInit.c:734]

Changing the address from *:5005 to localhost:5005 seems to work but then it's only bound to localhost. I know for a fact that *:5005 worked on JDK 12 and I can't find any changes regarding this, In fact JPDA spec still mentions the * option for jse 14 https://docs.oracle.com/en/java/javase/14/docs/specs/jpda/conninv.html. Anyone got any ideas what I can look into? Is it a bug or a feature for which I can't seem to find documentation for.

1

There are 1 answers

0
MrPlow On BEST ANSWER

As @apangin suggested in the comment. The solution is to specify the address as 0.0.0.0:5005 or to set the -Djava.net.preferIPv4Stack=true JVM parameter.