Hi,

Thanks for the reply.

I am, in fact, trying to start jmx/rmi on the loopback address 127.0.0.4,
but jetty insists on starting the rmi regisrty on 0.0.0.0 when it detects
you are using a loopback address (that the code I posted).

I have configured jetty-jmx-remote.xml

I am starting with these properties on the commandline:
 jetty.jmxremote.rmiport=1199 jetty.jmxremote.rmihost=127.0.0.4

After it starts, "netstat -an | grep 1199" shows

 TCP    0.0.0.0:1199           0.0.0.0:0              LISTENING

Which indicates that it is listen on all address not just 127.0.0.4

Is there any way I can limit it to just 127.0.0.4?

*Steven Katz | *Senior Director, Architecture
*Aol*Platforms*.*
*office**:*
* 617.874.5448 <6178745448>*
*email: [email protected] <[email protected]>*

On Tue, Jan 26, 2016 at 7:38 PM, Joakim Erdfelt <[email protected]> wrote:

> 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 / [email protected]
>
> On Tue, Jan 26, 2016 at 4:54 PM, Steven Katz <[email protected]>
> 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
>> *Aol*Platforms*.*
>> *office**:*
>> * 617.874.5448 <6178745448>*
>> *email: [email protected] <[email protected]>*
>>
>> _______________________________________________
>> jetty-users mailing list
>> [email protected]
>> To change your delivery options, retrieve your password, or unsubscribe
>> from this list, visit
>> https://dev.eclipse.org/mailman/listinfo/jetty-users
>>
>
>
> _______________________________________________
> jetty-users mailing list
> [email protected]
> To change your delivery options, retrieve your password, or unsubscribe
> from this list, visit
> https://dev.eclipse.org/mailman/listinfo/jetty-users
>
_______________________________________________
jetty-users mailing list
[email protected]
To change your delivery options, retrieve your password, or unsubscribe from 
this list, visit
https://dev.eclipse.org/mailman/listinfo/jetty-users

Reply via email to