I implemented RMIService using Spring RMIServiceExporter running at port 4099. When I start my Jboss , RMI Service is getting bonded to 0.0.0.0:4099 instead of 127.0.0.1:4099. I tried different parameters
-Djava.rmi.server.hostname=127.0.0.1
-Djava.rmi.server.hostname=localhost
-Djava.rmi.server.hostname=localhost.localdomain along with
-Djava.net.preferIPv4Stack=true parameter.
Started Jboss with -b 127.0.0.1
Its always getting bonded to 0.0.0.0:4099
. I check it using
>netstat -anp | grep 4099
>TCP 0.0.0.0:4099 0.0.0.0:0 LISTENING
Here is my implementation:
RmiServiceExporter rmiServiceExporter = new RmiServiceExporter();
rmiServiceExporter.setService(this);
rmiServiceExporter.setServiceName("MyService");
rmiServiceExporter.setServiceInterface(MyServiceManager.class);
rmiServiceExporter.setRegistryPort(4099);
rmiServiceExporter.afterPropertiesSet();