On Jul 28, 2010, at 6:18 AM, Henri Gomez wrote:
>> Dynamically adding a javaagent should work in java 1.6 and clearly the linux
>> jmv supports it just fine. Seems like a VM bug in the Snow Leopard box
>> ("MacosxAttachProvider" "MacosxVirtualMachine")
>>
>> Caused by: com.sun.tools.attach.AttachNotSupportedException: Unable to
>> open socket file: target process not responding or HotSpot VM not
>> loaded
>> at
>> sun.tools.attach.MacosxVirtualMachine.<init>(MacosxVirtualMachine.java:82)
>> at
>> sun.tools.attach.MacosxAttachProvider.attachVirtualMachine(MacosxAttachProvider.java:34)
>> at com.sun.tools.attach.VirtualMachine.attach(VirtualMachine.java:195)
>
> Yes, it seems to be Snow related.
>
>> Only way to workaround this is to do it the java 1.5 way of specifying the
>> javaagent statically on the command line.
>> The openejb installer webapp will do that setup for the static approach, but
>> you can also do it by hand as described above.
>
> The 'dynamic way' is just for Java 1.6 ?
Right. In java 5 the only way to get a javaagent installed is on the command
line and you can only enhance classes before they are loaded. In Java 6 you're
*supposed* to be able to add class transformers at runtime and enhance classes
even after they're loaded.
-David