river-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Jonathan Costers <jonathan.cost...@googlemail.com>
Subject Re: TaskManager progress
Date Mon, 16 Aug 2010 11:58:41 GMT
>
>
>     [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:
jonathan@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

Mime
  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message