activemq-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From gtu...@apache.org
Subject svn commit: r1341945 - /activemq/trunk/activemq-console/src/main/java/org/apache/activemq/console/command/AbstractJmxCommand.java
Date Wed, 23 May 2012 16:41:56 GMT
Author: gtully
Date: Wed May 23 16:41:55 2012
New Revision: 1341945

URL: http://svn.apache.org/viewvc?rev=1341945&view=rev
Log:
https://issues.apache.org/jira/browse/AMQ-3858 fix npe on not found vvm jmx url

Modified:
    activemq/trunk/activemq-console/src/main/java/org/apache/activemq/console/command/AbstractJmxCommand.java

Modified: activemq/trunk/activemq-console/src/main/java/org/apache/activemq/console/command/AbstractJmxCommand.java
URL: http://svn.apache.org/viewvc/activemq/trunk/activemq-console/src/main/java/org/apache/activemq/console/command/AbstractJmxCommand.java?rev=1341945&r1=1341944&r2=1341945&view=diff
==============================================================================
--- activemq/trunk/activemq-console/src/main/java/org/apache/activemq/console/command/AbstractJmxCommand.java
(original)
+++ activemq/trunk/activemq-console/src/main/java/org/apache/activemq/console/command/AbstractJmxCommand.java
Wed May 23 16:41:55 2012
@@ -341,16 +341,20 @@ public abstract class AbstractJmxCommand
                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");



Mime
View raw message