Connection refused when attaching to java 9 process

Egor Ushakov egor.ushakov at jetbrains.com
Wed Aug 29 10:02:30 UTC 2018


Hi,

First, I'm aware about changes in jdk 9 attach "security" 
(bugs.openjdk.java.net/browse/JDK-8175050 etc.).
One specific case is still bothering me:
I'm starting a process in server mode without specifying an address:

 >java -agentlib:jdwp=transport=dt_socket,server=y,suspend=n my.Endless
Listening for transport dt_socket at address: 50327

so it auto select an address for me (which is what I want), but now I'm 
unable to connect even from the same machine:

 >jdb -connect com.sun.jdi.SocketAttach:port=50327
java.net.ConnectException: Connection refused: connect
         at java.net.DualStackPlainSocketImpl.connect0(Native Method)
         at 
java.net.DualStackPlainSocketImpl.socketConnect(DualStackPlainSocketImpl.java:79)
...

Is it possible to connect in this configuration?

Thanks!

-- 
Egor Ushakov
Software Developer
JetBrains
http://www.jetbrains.com
The Drive to Develop



More information about the serviceability-dev mailing list