I try to retransform a class in a remote virtual machine (on the same host). An agent (packed in jar with correct values in manifest) is loaded, but the transformer never called, although I ask the Instrumentation to retransform the class explicitly in my Agent agentmain method (I verified that the following code is called):
instrumentation.addTransformer(new MyClassFileTransformer(), true);
instrumentation.retransformClasses(Class.forName("example.MyClassToTransform"));
Any ideas why the retransformation doesn't happen and what should I fix?