Author: ron.sigal(a)jboss.com
Date: 2008-03-07 03:02:02 -0500 (Fri, 07 Mar 2008)
New Revision: 3586
Modified:
remoting2/branches/2.x/src/main/org/jboss/remoting/ident/Identity.java
Log:
JBREM-901: get() uses "127.0.0.1" as backup address.
Modified: remoting2/branches/2.x/src/main/org/jboss/remoting/ident/Identity.java
===================================================================
--- remoting2/branches/2.x/src/main/org/jboss/remoting/ident/Identity.java 2008-03-07
07:43:44 UTC (rev 3585)
+++ remoting2/branches/2.x/src/main/org/jboss/remoting/ident/Identity.java 2008-03-07
08:02:02 UTC (rev 3586)
@@ -28,6 +28,7 @@
import java.io.File;
import java.io.FileInputStream;
import java.io.FileOutputStream;
+import java.io.IOException;
import java.io.InputStream;
import java.io.OutputStream;
import java.io.Serializable;
@@ -201,8 +202,18 @@
}
try
{
+ InetAddress localHost = null;
+ try
+ {
+ localHost = InetAddress.getLocalHost();
+ }
+ catch (IOException e)
+ {
+ localHost = InetAddress.getByName("127.0.0.1");
+ }
+
String serverid = (String) server.getAttribute(new
ObjectName("JMImplementation:type=MBeanServerDelegate"),
"MBeanServerId");
- Identity identity = new Identity(InetAddress.getLocalHost(), createId(server),
serverid);
+ Identity identity = new Identity(localHost, createId(server), serverid);
identities.put(server, identity);
return identity;
}
Show replies by date