Suppose I have a box whose hostname is not resolvable via DNS (I know, I know, but for people demo'ing software on a laptop, we've seen it happen). So, I cannot "ping `hostname`" but I can "ping 127.0.0.1".
Look at NetworkRegistry:
public ObjectName preRegister(MBeanServer mBeanServer, ObjectName objectName) throws Exception { this.mBeanServer = mBeanServer; this.objectName = objectName; // make sure our identity system property is properly set Identity identity = Identity.get(this.mBeanServer); ...
if(identities.containsKey(server)) { return (Identity) identities.get(server); } try { String serverid = (String) server.getAttribute(new ObjectName("JMImplementation:type=MBeanServerDelegate"), "MBeanServerId"); Identity identity = new Identity(InetAddress.getLocalHost(), createId(server), serverid); identities.put(server, identity); return identity; }
Hi John,
I assigned JBREM-901 "can't start NetworkRegistry if hostname is not resolvable" to release 2.4.0.CR1. I can't think of an automated unit test for it. Could you test it when the fix is in?
Thanks,
Ron