On 8/16/2010 6:15 AM, Patricia Shanahan wrote:
Jonathan Costers wrote:

[java] Test process was destroyed and returned code 1
[java] com/sun/jini/test/impl/joinmanager/LeaseRenewDurRFE.td
[java] Test Failed: Unexpected Exception in setup:
java.security.AccessControlException: origin is non-local host


I had the same issue on Ubuntu.

The reason seems to be the default network configuration in Ubuntu:
jonat...@calisto:~$ cat /etc/hosts
127.0.0.1 localhost
127.0.1.1 calisto

Notice the second line.

Now, in com.sun.jini.phoenix.LocalAccess, a check is being done on
whether
the client is a local host:
...
InetAddress addr = host.getClientHost();
Boolean ok = (Boolean) cache.get(addr);
if (ok == null) {
try {
ok = Boolean.valueOf(NetworkInterface.getByInetAddress(
addr) != null);
} catch (IOException e) {
ok = Boolean.FALSE;
}
cache.put(addr, ok);
}
if (!ok.booleanValue()) {
throw new AccessControlException("origin is non-local host");
}

However, this check does not work for the above configuration in Ubuntu
(hostname associated with a loopback address, but not with 127.0.0.1).
The check only looks at physical network interfaces to determine
whether the
client is a local host.

A fix could be to add an extra check on loopback addresses (which I
tested
and seems to work in my case):
ok = Boolean.valueOf(NetworkInterface.getByInetAddress(
addr) != null || addr.isLoopbackAddress());

Or to change /etc/hosts (which I've also tested):
127.0.0.1 localhost calisto


Thanks. I have tests of both these running. Assuming both also work for
me, which is the better fix?

I'm not a networking expert, but it seems to me to be logical to treat
any and all loop back addresses as being local, so my initial preference
is the source code fix.

Opinions?

Both these solutions indeed work for me.

Patricia

Reply via email to