Connection refused when attaching to java 9 process

Egor Ushakov egor.ushakov at jetbrains.com
Wed Aug 29 10:50:26 UTC 2018


this one I was able to overcome specifying the "hostname=127.0.0.1":

 >jdb -connect com.sun.jdi.SocketAttach:port=50327,hostname=127.0.0.1 - 
works well now, though strange

but ProcessAttach still does not work:

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



On 29-Aug-18 13:02, Egor Ushakov wrote:
> 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