I'm trying to connect my debugger to Wildlfy running on Open JDK 11.
Despite Wildfly says:
Listening for transport dt_socket at address: 8787
My IDE (IntelliJ IDEA CE 2018.1) claims that it doesn't get any connection:
Unable to open debugger port (localhost:8787): java.io.IOException "handshake failed - connection prematurally closed"
.
I'm starting Wildfly via standalone.sh --debug
resulting in the following JAVA_OPTS
:
-server
-Xms64m
-Xmx512m
-XX:MetaspaceSize=96M
-XX:MaxMetaspaceSize=256m
-Djava.net.preferIPv4Stack=true
-Djboss.modules.system.pkgs=org.jboss.byteman
-Djava.awt.headless=true
-agentlib:jdwp=transport=dt_socket,address=8787,server=y,suspend=n
--add-exports=java.base/sun.nio.ch=ALL-UNNAMED
--add-exports=jdk.unsupported/sun.misc=ALL-UNNAMED
--add-exports=jdk.unsupported/sun.reflect=ALL-UNNAMED
--add-modules=java.se
Did something change in Java 9/10/11? Remote debugging with the exact same setup works fine when using Oracle JDK 8.
Using telnet I can confirm, that port 8787
is indeed not reachable.
Update after reading @ehsavoie's comment: netstat -ln
on the server running Wildfly shows:
Proto Recv-Q Send-Q Local Address Foreign Address State
tcp 0 0 127.0.0.1:8787 0.0.0.0:* LISTEN
So apparently with OpenJDK 11 the debug port is now bound to localhost by default.