Remote debugging: No connection to Wildfly 14 on OpenJDK 11 at port 8787











up vote
1
down vote

favorite












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.










share|improve this question
























  • Few doubts in general - Does that work on any other port by the way? What is the content of standalone.sh? How about tracing any failure logs for this?
    – nullpointer
    Nov 8 at 3:17












  • standalone.sh is the unpatched file from Wildfly 14.0.1. Like what other ports? Wildfly is reachable via 8080, 8443 and 9990. 8787 is clearly exposed as debug port in the aforementioned JAVA_OPTS.
    – Sebastian S
    Nov 8 at 7:39






  • 1




    and if you set suspend to yes (y) does the startup suspend ? Just checking that the debug option is taken into account by the JVM
    – ehsavoie
    Nov 8 at 8:04










  • @ehsavoie indeed Wildfly suspends after logging Listening for transport dt_socket at address: 8787. However my IDE (IntelliJ Idea) still says Unable to open debugger port (localhost:8787): java.io.IOException "handshake failed - connection prematurally closed"
    – Sebastian S
    Nov 8 at 9:00








  • 1




    What does netstat -ln show ?
    – ehsavoie
    Nov 8 at 14:32















up vote
1
down vote

favorite












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.










share|improve this question
























  • Few doubts in general - Does that work on any other port by the way? What is the content of standalone.sh? How about tracing any failure logs for this?
    – nullpointer
    Nov 8 at 3:17












  • standalone.sh is the unpatched file from Wildfly 14.0.1. Like what other ports? Wildfly is reachable via 8080, 8443 and 9990. 8787 is clearly exposed as debug port in the aforementioned JAVA_OPTS.
    – Sebastian S
    Nov 8 at 7:39






  • 1




    and if you set suspend to yes (y) does the startup suspend ? Just checking that the debug option is taken into account by the JVM
    – ehsavoie
    Nov 8 at 8:04










  • @ehsavoie indeed Wildfly suspends after logging Listening for transport dt_socket at address: 8787. However my IDE (IntelliJ Idea) still says Unable to open debugger port (localhost:8787): java.io.IOException "handshake failed - connection prematurally closed"
    – Sebastian S
    Nov 8 at 9:00








  • 1




    What does netstat -ln show ?
    – ehsavoie
    Nov 8 at 14:32













up vote
1
down vote

favorite









up vote
1
down vote

favorite











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.










share|improve this question















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.







java debugging wildfly remote-debugging java-11






share|improve this question















share|improve this question













share|improve this question




share|improve this question








edited yesterday









Mikhail Kholodkov

3,49342141




3,49342141










asked Nov 7 at 22:24









Sebastian S

2,05511535




2,05511535












  • Few doubts in general - Does that work on any other port by the way? What is the content of standalone.sh? How about tracing any failure logs for this?
    – nullpointer
    Nov 8 at 3:17












  • standalone.sh is the unpatched file from Wildfly 14.0.1. Like what other ports? Wildfly is reachable via 8080, 8443 and 9990. 8787 is clearly exposed as debug port in the aforementioned JAVA_OPTS.
    – Sebastian S
    Nov 8 at 7:39






  • 1




    and if you set suspend to yes (y) does the startup suspend ? Just checking that the debug option is taken into account by the JVM
    – ehsavoie
    Nov 8 at 8:04










  • @ehsavoie indeed Wildfly suspends after logging Listening for transport dt_socket at address: 8787. However my IDE (IntelliJ Idea) still says Unable to open debugger port (localhost:8787): java.io.IOException "handshake failed - connection prematurally closed"
    – Sebastian S
    Nov 8 at 9:00








  • 1




    What does netstat -ln show ?
    – ehsavoie
    Nov 8 at 14:32


















  • Few doubts in general - Does that work on any other port by the way? What is the content of standalone.sh? How about tracing any failure logs for this?
    – nullpointer
    Nov 8 at 3:17












  • standalone.sh is the unpatched file from Wildfly 14.0.1. Like what other ports? Wildfly is reachable via 8080, 8443 and 9990. 8787 is clearly exposed as debug port in the aforementioned JAVA_OPTS.
    – Sebastian S
    Nov 8 at 7:39






  • 1




    and if you set suspend to yes (y) does the startup suspend ? Just checking that the debug option is taken into account by the JVM
    – ehsavoie
    Nov 8 at 8:04










  • @ehsavoie indeed Wildfly suspends after logging Listening for transport dt_socket at address: 8787. However my IDE (IntelliJ Idea) still says Unable to open debugger port (localhost:8787): java.io.IOException "handshake failed - connection prematurally closed"
    – Sebastian S
    Nov 8 at 9:00








  • 1




    What does netstat -ln show ?
    – ehsavoie
    Nov 8 at 14:32
















Few doubts in general - Does that work on any other port by the way? What is the content of standalone.sh? How about tracing any failure logs for this?
– nullpointer
Nov 8 at 3:17






Few doubts in general - Does that work on any other port by the way? What is the content of standalone.sh? How about tracing any failure logs for this?
– nullpointer
Nov 8 at 3:17














standalone.sh is the unpatched file from Wildfly 14.0.1. Like what other ports? Wildfly is reachable via 8080, 8443 and 9990. 8787 is clearly exposed as debug port in the aforementioned JAVA_OPTS.
– Sebastian S
Nov 8 at 7:39




standalone.sh is the unpatched file from Wildfly 14.0.1. Like what other ports? Wildfly is reachable via 8080, 8443 and 9990. 8787 is clearly exposed as debug port in the aforementioned JAVA_OPTS.
– Sebastian S
Nov 8 at 7:39




1




1




and if you set suspend to yes (y) does the startup suspend ? Just checking that the debug option is taken into account by the JVM
– ehsavoie
Nov 8 at 8:04




and if you set suspend to yes (y) does the startup suspend ? Just checking that the debug option is taken into account by the JVM
– ehsavoie
Nov 8 at 8:04












@ehsavoie indeed Wildfly suspends after logging Listening for transport dt_socket at address: 8787. However my IDE (IntelliJ Idea) still says Unable to open debugger port (localhost:8787): java.io.IOException "handshake failed - connection prematurally closed"
– Sebastian S
Nov 8 at 9:00






@ehsavoie indeed Wildfly suspends after logging Listening for transport dt_socket at address: 8787. However my IDE (IntelliJ Idea) still says Unable to open debugger port (localhost:8787): java.io.IOException "handshake failed - connection prematurally closed"
– Sebastian S
Nov 8 at 9:00






1




1




What does netstat -ln show ?
– ehsavoie
Nov 8 at 14:32




What does netstat -ln show ?
– ehsavoie
Nov 8 at 14:32

















active

oldest

votes











Your Answer






StackExchange.ifUsing("editor", function () {
StackExchange.using("externalEditor", function () {
StackExchange.using("snippets", function () {
StackExchange.snippets.init();
});
});
}, "code-snippets");

StackExchange.ready(function() {
var channelOptions = {
tags: "".split(" "),
id: "1"
};
initTagRenderer("".split(" "), "".split(" "), channelOptions);

StackExchange.using("externalEditor", function() {
// Have to fire editor after snippets, if snippets enabled
if (StackExchange.settings.snippets.snippetsEnabled) {
StackExchange.using("snippets", function() {
createEditor();
});
}
else {
createEditor();
}
});

function createEditor() {
StackExchange.prepareEditor({
heartbeatType: 'answer',
convertImagesToLinks: true,
noModals: true,
showLowRepImageUploadWarning: true,
reputationToPostImages: 10,
bindNavPrevention: true,
postfix: "",
imageUploader: {
brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
allowUrls: true
},
onDemand: true,
discardSelector: ".discard-answer"
,immediatelyShowMarkdownHelp:true
});


}
});














 

draft saved


draft discarded


















StackExchange.ready(
function () {
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f53198798%2fremote-debugging-no-connection-to-wildfly-14-on-openjdk-11-at-port-8787%23new-answer', 'question_page');
}
);

Post as a guest





































active

oldest

votes













active

oldest

votes









active

oldest

votes






active

oldest

votes
















 

draft saved


draft discarded



















































 


draft saved


draft discarded














StackExchange.ready(
function () {
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f53198798%2fremote-debugging-no-connection-to-wildfly-14-on-openjdk-11-at-port-8787%23new-answer', 'question_page');
}
);

Post as a guest