vm = VirtualMachine.attach(name); } catch (AttachNotSupportedException x) { throw new IOException(x.getMessage(), x);
x.printStackTrace(System.err);
public WindowsVirtualMachine(AttachProvider provider, String id) throws AttachNotSupportedException, IOException { super(provider, id); int pid; try { pid = Integer.parseInt(id); } catch (NumberFormatException x) { throw new AttachNotSupportedException("Invalid process identifier"); } hProcess = openProcess(pid); // The target VM might be a pre-6.0 VM so we enqueue a "null" command // which minimally tests that the enqueue function exists in the target // VM. try { enqueue(hProcess, stub, null, null); } catch (IOException x) { throw new AttachNotSupportedException(x.getMessage()); } }
pid = Integer.parseInt(vmid); } catch (NumberFormatException x) { throw new AttachNotSupportedException("invalid process identifier"); } while (i <= retries && fd == -1); if (fd == -1) { throw new AttachNotSupportedException( "Unable to open door: target process not responding or " + "HotSpot VM not loaded");
vm = VirtualMachine.attach(pid); } catch (AttachNotSupportedException x) { IOException ioe = new IOException(x.getMessage()); ioe.initCause(x); throw ioe;
pid = Integer.parseInt(vmid); } catch (NumberFormatException x) { throw new AttachNotSupportedException("Invalid process identifier"); } while (i <= retries && path == null); if (path == null) { throw new AttachNotSupportedException( "Unable to open socket file: target process not responding " + "or HotSpot VM not loaded");
System.exit(1); } catch (AttachNotSupportedException ex) { ex.printStackTrace(); System.exit(1); } catch (AgentInitializationException ex) {
throw new IOException( x.getMessage(), x );
throws AttachNotSupportedException, IOException { if (vmd.provider() != this) { throw new AttachNotSupportedException("provider mismatch");
IOException ioe = new IOException(x.getMessage()); ioe.initCause(x); throw ioe;
throw new AttachNotSupportedException("provider mismatch");
vm = VirtualMachine.attach(name); } catch (AttachNotSupportedException x) { throw new IOException(x.getMessage(), x);
pid = Integer.parseInt(vmid); } catch (NumberFormatException x) { throw new AttachNotSupportedException("Invalid process identifier"); mpid = getLinuxThreadsManager(pid); } catch (IOException x) { throw new AttachNotSupportedException(x.getMessage()); } while (i <= retries && path == null); if (path == null) { throw new AttachNotSupportedException( "Unable to open socket file: target process not responding " + "or HotSpot VM not loaded");
public static void loadAgent(String pid, String args) throws IOException { VirtualMachine vm = null; try { vm = VirtualMachine.attach(pid); } catch (AttachNotSupportedException x) { IOException ioe = new IOException(x.getMessage()); ioe.initCause(x); throw ioe; } try { String agent = ApmAgentLauncher.class.getProtectionDomain().getCodeSource().getLocation().getPath(); System.err.println("Trying to load agent " + agent); vm.loadAgent(agent, args); System.out.println("Agent successfully loaded"); } catch (AgentLoadException x) { IOException ioe = new IOException(x.getMessage()); ioe.initCause(x); throw ioe; } catch (AgentInitializationException x) { IOException ioe = new IOException(x.getMessage()); ioe.initCause(x); throw ioe; } finally { if (vm != null) { vm.detach(); } } } }
throw new AttachNotSupportedException( "Unable to open socket file: target process not responding " + "or HotSpot VM not loaded");
throw new IOException( x.getMessage(), x );