Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
Re: [jetty-users] RMI Server on loopback

I think you meant the jmx ConnectorServer, not the ConnectorService

That address (127.0.0.4) is loopback, and will start the JMX registry.

Test it yourself.

        InetAddress addr = InetAddress.getByName("127.0.0.4");
        System.out.printf("Addr %s isLoopbackAddress = %b%n", addr, addr.isLoopbackAddress());

If you get false, then you have a more fundamental configuration issue to noodle through, as the default implementation of java.net.Inet4Address.isLoopbackAddress() just checks that the first octet for the IP is 127.


Joakim Erdfelt / joakim@xxxxxxxxxxx

On Tue, Jan 26, 2016 at 4:54 PM, Steven Katz <steven.katz@xxxxxxxxxxx> wrote:
I'm trying to start jetty so that jmx and the rmi registry are started on a loopback address (specifically, 127.0.0.4).  The code seem to specifically disallow this.  

From ConnectorService:

        if(hostAddress.isLoopbackAddress())
        {
            if (rmiPort == 0)
            {
                ServerSocket socket = new ServerSocket(0);
                rmiPort = socket.getLocalPort();
                socket.close();
            }
            else
            {
                try
                {
                    // Check if a local registry is already running
                    LocateRegistry.getRegistry(rmiPort).list();
                    return null;
                }
                catch (Exception ex)
                {
                    LOG.ignore(ex);
                }
            }

            _registry = LocateRegistry.createRegistry(rmiPort);
            Thread.sleep(1000);

            rmiHost = InetAddress.getLocalHost().getCanonicalHostName();
            return rmiHost + ':' + Integer.toString(rmiPort);
        }


Does anyone know why this is the case or a way I can work around it?

Steven Katz | Senior Director, Architecture
AolPlatforms.
office: 617.874.5448
email: steven.katz@xxxxxxxxxxx

_______________________________________________
jetty-users mailing list
jetty-users@xxxxxxxxxxx
To change your delivery options, retrieve your password, or unsubscribe from this list, visit
https://dev.eclipse.org/mailman/listinfo/jetty-users


Back to the top