Author: violetagg
Date: Tue Feb  4 13:50:53 2014
New Revision: 1564299

URL: http://svn.apache.org/r1564299
Log:
Fix https://issues.apache.org/bugzilla/show_bug.cgi?id=56096
When creating JMXConnectorServer use the correct rmiBindAddress. Patch provided 
by Jim Talbut.

Modified:
    tomcat/trunk/java/org/apache/catalina/mbeans/JmxRemoteLifecycleListener.java

Modified: 
tomcat/trunk/java/org/apache/catalina/mbeans/JmxRemoteLifecycleListener.java
URL: 
http://svn.apache.org/viewvc/tomcat/trunk/java/org/apache/catalina/mbeans/JmxRemoteLifecycleListener.java?rev=1564299&r1=1564298&r2=1564299&view=diff
==============================================================================
--- 
tomcat/trunk/java/org/apache/catalina/mbeans/JmxRemoteLifecycleListener.java 
(original)
+++ 
tomcat/trunk/java/org/apache/catalina/mbeans/JmxRemoteLifecycleListener.java 
Tue Feb  4 13:50:53 2014
@@ -256,7 +256,7 @@ public class JmxRemoteLifecycleListener 
 
 
             // Create the Platform server
-            csPlatform = createServer("Platform", rmiRegistryPortPlatform,
+            csPlatform = createServer("Platform", rmiBindAddress, 
rmiRegistryPortPlatform,
                     rmiServerPortPlatform, env, csf, ssf,
                     ManagementFactory.getPlatformMBeanServer());
 
@@ -266,7 +266,7 @@ public class JmxRemoteLifecycleListener 
     }
 
     private JMXConnectorServer createServer(String serverName,
-            int theRmiRegistryPort, int theRmiServerPort,
+            String bindAddress, int theRmiRegistryPort, int theRmiServerPort,
             HashMap<String,Object> theEnv, RMIClientSocketFactory csf,
             RMIServerSocketFactory ssf, MBeanServer theMBeanServer) {
 
@@ -280,11 +280,19 @@ public class JmxRemoteLifecycleListener 
             return null;
         }
 
+        if (bindAddress == null) {
+            bindAddress = "localhost";
+        }
+
         // Build the connection string with fixed ports
         StringBuilder url = new StringBuilder();
-        url.append("service:jmx:rmi://localhost:");
+        url.append("service:jmx:rmi://");
+        url.append(bindAddress);
+        url.append(":");
         url.append(theRmiServerPort);
-        url.append("/jndi/rmi://localhost:");
+        url.append("/jndi/rmi://");
+        url.append(bindAddress);
+        url.append(":");
         url.append(theRmiRegistryPort);
         url.append("/jmxrmi");
         JMXServiceURL serviceUrl;



---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscr...@tomcat.apache.org
For additional commands, e-mail: dev-h...@tomcat.apache.org

Reply via email to