Skip to main content

AttachAPI fails on Mac when is defined for parent process but not for forked process

Please note these forums are being decommissioned and use the new and improved forums at
No replies
Joined: 2008-10-22

I have a project in Maven where I want to pass in a new value for the

This works fine when running on linux or windows, but it fails on Mac with the following stack trace:

<span class="Apple-style-span" style="color: rgb(0, 0, 0); font-family: 'Lucida Console', Monaco, 'DejaVu Sans Mono', monospace; line-height: normal; white-space: pre-wrap; background-color: rgb(255, 255, 255); ">Caused by: Unable to open socket file: target process not responding or HotSpot VM not loaded</span>


Looking at the code, it would appear that MacosxVirtualMachine is relying on finding a file nameed .java_pid<int> in the directory.

Unfortunately, it appears that is different for the parent process and the child process, (according to so the file is not found.

Whatever code that windows or linux uses is not relying on the pid file being in the tmp directory, so it works.

This error has been found and reported here: and also here:

It appears to be a bug specific to MacosxAttachProvider/MacosxVirtualMachiine.