-
1. Re: HA JNDI with no bind address
fuzzybinary Oct 3, 2007 1:06 PM (in response to fuzzybinary)To clarify, what I'm looking for (I think) is for the HA-JNDI to report a IP address to connect to instead of a host name. It looks like the host name is coming from either the bind.address or java.rmi.server.hostname variable.
Things I've tried so far:
- Changing the Host attribute to {jboss.bind.address}
- Using the -Djava.rmi.server.useLocalHostname=false switch. -
2. Re: HA JNDI with no bind address
fuzzybinary Oct 3, 2007 3:22 PM (in response to fuzzybinary)So, upon further investigation, I have found that this is indeed not possible without code changes. The offending code that makes it impossible:
From system/src/main/org/jboss/Main.java:454if (rmiHost == null) { rmiHost = ServerConfigUtil.fixRemoteAddress(arg); Enumeration ifaces = NetworkInterface.getNetworkInterfaces(); System.setProperty("java.rmi.server.hostname", rmiHost); }
From system/src/main/org/jboss/system/server/ServerConfigUtil.javapublic static String fixRemoteAddress(String address) { try { if (address == null || ANY.equals(address)) return InetAddress.getLocalHost().getHostName(); } catch (UnknownHostException ignored) { } return address; }
Which makes it impossible to bind to all addresses *and* have an IP resolve for RMI.
I have a local fix, which checks to see if the name supplied can be resolved to anything other than localhost and, if not, grabs the first (non-loopback) IP address it can find through enumerating the network interfaces. This would not work on a multi-homed machine, but a -b with the actual IP address would probably be fine there. -
3. Re: HA JNDI with no bind address
brian.stansberry Oct 3, 2007 4:16 PM (in response to fuzzybinary)Have you tried:
./run.sh -c all -b 0.0.0.0 -Djava.rmi.server.hostname=xxx.xxx.xxx.xxx ?
Your workaround is of course more dynamic. -
4. Re: HA JNDI with no bind address
kobiianko May 27, 2010 8:02 AM (in response to fuzzybinary)Hi Jeff, I'm tring to do the same thing, could you elaborate the steps needed to do it?
10x, Kobi