mirror of https://github.com/apache/activemq.git
https://issues.apache.org/jira/browse/AMQ-3858 fix npe on not found vvm jmx url
git-svn-id: https://svn.apache.org/repos/asf/activemq/trunk@1341945 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
parent
144dda0308
commit
8b2875e19e
|
@ -341,16 +341,20 @@ public abstract class AbstractJmxCommand extends AbstractCommand {
|
|||
context.print("Connecting to pid: " + pid);
|
||||
|
||||
String jmxUrl = findJMXUrlByProcessId(pid);
|
||||
// If jmx url already specified
|
||||
if (getJmxServiceUrl() != null) {
|
||||
context.printException(new IllegalArgumentException("JMX URL already specified."));
|
||||
tokens.clear();
|
||||
}
|
||||
try {
|
||||
this.setJmxServiceUrl(new JMXServiceURL(jmxUrl));
|
||||
} catch (MalformedURLException e) {
|
||||
context.printException(e);
|
||||
tokens.clear();
|
||||
if (jmxUrl != null) {
|
||||
// If jmx url already specified
|
||||
if (getJmxServiceUrl() != null) {
|
||||
context.printException(new IllegalArgumentException("JMX URL already specified."));
|
||||
tokens.clear();
|
||||
}
|
||||
try {
|
||||
this.setJmxServiceUrl(new JMXServiceURL(jmxUrl));
|
||||
} catch (MalformedURLException e) {
|
||||
context.printException(e);
|
||||
tokens.clear();
|
||||
}
|
||||
} else {
|
||||
context.printInfo("failed to resolve jmxUrl for pid:" + pid + ", using default JMX url");
|
||||
}
|
||||
} else {
|
||||
context.printInfo("--pid option is not available for this VM, using default JMX url");
|
||||
|
|
Loading…
Reference in New Issue