8061312: Even more debug output needed

Reviewed-by: sla, olagneau
This commit is contained in:
Jaroslav Bachorik 2014-10-17 12:20:34 +02:00
parent d03eadea27
commit c27e2c99f4

View File

@ -100,6 +100,7 @@ public class StartManagementAgent {
ex.printStackTrace(System.err); ex.printStackTrace(System.err);
} catch (Throwable t) { } catch (Throwable t) {
t.printStackTrace(System.err); t.printStackTrace(System.err);
throw t;
} }
} }
@ -124,6 +125,7 @@ public class StartManagementAgent {
try { try {
System.err.println("Trying remote agent. Try #" + i); System.err.println("Trying remote agent. Try #" + i);
testRemoteAgent(vm); testRemoteAgent(vm);
System.err.println("Successfully connected to remote agent");
success = true; success = true;
} catch(Exception ex) { } catch(Exception ex) {
System.err.println("testRemoteAgent failed with exception:"); System.err.println("testRemoteAgent failed with exception:");
@ -136,7 +138,9 @@ public class StartManagementAgent {
throw new Exception("testRemoteAgent failed after " + MAX_RETRIES + " tries"); throw new Exception("testRemoteAgent failed after " + MAX_RETRIES + " tries");
} }
} finally { } finally {
System.err.println("Detaching from VM ...");
vm.detach(); vm.detach();
System.err.println("Detached");
} }
} }
@ -176,7 +180,10 @@ public class StartManagementAgent {
mgmtProps.put("com.sun.management.jmxremote.port", port); mgmtProps.put("com.sun.management.jmxremote.port", port);
mgmtProps.put("com.sun.management.jmxremote.authenticate", "false"); mgmtProps.put("com.sun.management.jmxremote.authenticate", "false");
mgmtProps.put("com.sun.management.jmxremote.ssl", "false"); mgmtProps.put("com.sun.management.jmxremote.ssl", "false");
System.err.println("Starting management agent ...");
vm.startManagementAgent(mgmtProps); vm.startManagementAgent(mgmtProps);
System.err.println("Started");
// try to connect - should work // try to connect - should work
tryConnect(port, true); tryConnect(port, true);
@ -184,9 +191,12 @@ public class StartManagementAgent {
// try to start again - should fail // try to start again - should fail
boolean exception = false; boolean exception = false;
try { try {
System.err.println("Starting management agent second time ...");
vm.startManagementAgent(mgmtProps); vm.startManagementAgent(mgmtProps);
System.err.println("Started");
} catch(AttachOperationFailedException ex) { } catch(AttachOperationFailedException ex) {
// expected // expected
System.err.println("Got expected exception: " + ex.getMessage());
exception = true; exception = true;
} }
if (!exception) { if (!exception) {
@ -204,10 +214,14 @@ public class StartManagementAgent {
boolean succeeded; boolean succeeded;
try { try {
System.err.println("Trying to connect to " + jmxUrlStr);
JMXConnector c = JMXConnectorFactory.connect(url, env); JMXConnector c = JMXConnectorFactory.connect(url, env);
System.err.println("Connected, getting MBeanServerConnection");
c.getMBeanServerConnection(); c.getMBeanServerConnection();
System.err.println("Success");
succeeded = true; succeeded = true;
} catch(Exception ex) { } catch(Exception ex) {
ex.printStackTrace(System.err);
succeeded = false; succeeded = false;
} }
if (succeeded && !shouldSucceed) { if (succeeded && !shouldSucceed) {