0 Replies Latest reply on Sep 5, 2013 10:51 AM by Bhaskar Kumar

    How to start RMI with public IP when JBOSS is bound to 127.0.0.1

    Bhaskar Kumar Newbie

      I am using Jboss 5.1. Earlier I was binding Jboss to 0.0.0.0. But for security reasons, I have got a requirement to bind my Jboss to localhost (127.0.0.1) so that all my ports are connected to localhost instead of public IPs.

       

      Once I try starting Jboss with run.sh -b 127.0.0.1, my Jboss doesnot come up because my RMI server is bound to public IP of my server ( -Djava.rmi.server.hostname=192.168.2.83). The exception is below:

       

      2013-09-03 03:48:21,613 EDT ERROR [main] AbstractKernelController - Error installing to Start: name=jboss.remoting:protocol=rmi,service=JMXConnectorServer state=Create mode=Manual requiredState=Installed

      java.io.IOException: Cannot bind to URL [rmi://192.168.2.83:1090/jmxconnector]: javax.naming.ServiceUnavailableException [Root exception is java.rmi.ConnectException: Connection refused to host: 192.168.2.83; nested exception is:

              java.net.ConnectException: Connection refused]

              at javax.management.remote.rmi.RMIConnectorServer.newIOException(RMIConnectorServer.java:827)

              at javax.management.remote.rmi.RMIConnectorServer.start(RMIConnectorServer.java:432)

              at org.jboss.mx.remoting.service.JMXConnectorServerService.start(JMXConnectorServerService.java:131)

             .

             .

             .

             .

             .

      Caused by: javax.naming.ServiceUnavailableException [Root exception is java.rmi.ConnectException: Connection refused to host: 192.168.2.83; nested exception is:

              java.net.ConnectException: Connection refused]

              at com.sun.jndi.rmi.registry.RegistryContext.bind(RegistryContext.java:143)

              at com.sun.jndi.toolkit.url.GenericURLContext.bind(GenericURLContext.java:226)

              at javax.naming.InitialContext.bind(InitialContext.java:419)

              at javax.management.remote.rmi.RMIConnectorServer.bind(RMIConnectorServer.java:644)

              at javax.management.remote.rmi.RMIConnectorServer.start(RMIConnectorServer.java:427)

              ... 65 more

       

       

      I need some help on this. I have to start Jboss with -b 127.0.0.1 with RMI server hostname as public IP (-Djava.rmi.server.hostname=192.168.2.83). How can I bind my RMI on public IP of my server when I am starting my Jboss with -b 127.0.0.1?