com.sun.tools.attach.AttachNotSupportedException: Unable to open socket file: target process not responding or HotSpot VM not loaded

后端 未结 4 1250
野的像风
野的像风 2020-12-08 22:42

I get AttachNotSupportedException while running jmockit tests on linux (ubuntu 64bit). Java version is 1.7.0_51. This JDK is from Oracle. Tests are run using

4条回答
  •  北海茫月
    2020-12-08 23:14

    My answer will be a little bit unrelated, but I had same issue while trying to dump threads using jcmd. I was getting same error message even though I was running jcmd under the root user.

    You need to run jcmd Thread.dump under the same user as java process has, otherwise your connections will be dropped. Java doesn't care if you are root or not.

    So basically:

    sudo -u  jcmd  Thread.dump
    

提交回复
热议问题