title: java.rmi.ConnectException: Connection refused to host: 192.168.0.55
body: <p>I am quite a beginner with NetBeans and Java, so I'm pretty sure my questions are very basic but trying to find the solution for 2 weeks I am totally stuck</p>
  
  <p>This is the problem:</p>
  
  <p>I want to implement a RMI Server Client application
  So first step was trying with NetBeans to have one work from the net</p>
  
  <p>I used the oracle tutorial to have the first part implemented
  <a href="http://docs.oracle.com/javase/tutorial/rmi/server.html" rel="nofollow">http://docs.oracle.com/javase/tutorial/rmi/server.html</a></p>
  
  <p>My problem is not that the client does not connect, but that the server can't even register in the port I give him. The IP in the error message is my private IP.</p>
  
  <p>This is the error message I get:</p>
  
  <pre><code>Conectando a:  127.0.0.1 / 19400 / PlanificadorTalsa
  ServidorPlanificadorStarter exception:
  java.rmi.ConnectException: Connection refused to host: 192.168.0.55; nested exception is: 
      java.net.ConnectException: Connection refused: connect
      at sun.rmi.transport.tcp.TCPEndpoint.newSocket(TCPEndpoint.java:619)
      at sun.rmi.transport.tcp.TCPChannel.createConnection(TCPChannel.java:216)
      at sun.rmi.transport.tcp.TCPChannel.newConnection(TCPChannel.java:202)
      at sun.rmi.server.UnicastRef.newCall(UnicastRef.java:342)
      at sun.rmi.registry.RegistryImpl_Stub.rebind(Unknown Source)
      at   Starter.ServidorPlanificadorStarter.main(ServidorPlanificadorStarter.java:52)
  Caused by: java.net.ConnectException: Connection refused: connect
      at java.net.DualStackPlainSocketImpl.connect0(Native Method)
      at java.net.DualStackPlainSocketImpl.socketConnect(DualStackPlainSocketImpl.java:79)
      at java.net.AbstractPlainSocketImpl.doConnect(AbstractPlainSocketImpl.java:345)
      at java.net.AbstractPlainSocketImpl.connectToAddress(AbstractPlainSocketImpl.java:206)
      at java.net.AbstractPlainSocketImpl.connect(AbstractPlainSocketImpl.java:188)
      at java.net.PlainSocketImpl.connect(PlainSocketImpl.java:172)
      at java.net.SocksSocketImpl.connect(SocksSocketImpl.java:392)
      at java.net.Socket.connect(Socket.java:589)
      at java.net.Socket.connect(Socket.java:538)
      at java.net.Socket.&lt;init&gt;(Socket.java:434)
      at java.net.Socket.&lt;init&gt;(Socket.java:211)
      at sun.rmi.transport.proxy.RMIDirectSocketFactory.createSocket(RMIDirectSocketFactory.java:40)
      at sun.rmi.transport.proxy.RMIMasterSocketFactory.createSocket(RMIMasterSocketFactory.java:148)
      at sun.rmi.transport.tcp.TCPEndpoint.newSocket(TCPEndpoint.java:613)
      ... 5 more
  </code></pre>
  
  <p>I am running windows 8.1, and disabled firewall. I am also using a security file granting all permissions</p>
  
  <p>this is my java code I execute from NetBeans:</p>
  
  <pre><code>import Conexion.DatosConexion;
  import Servidor.*;
  
  import java.rmi.RemoteException;
  import java.rmi.registry.LocateRegistry;
  import java.rmi.registry.Registry;
  import java.rmi.server.UnicastRemoteObject;
  
  public class ServidorPlanificadorStarter implements InterfazServidorPlanificador {
  
     private static String ip;
     private static String Servidor = "SERVIDORNUBE";
     private static int puerto;
     private static String nombreServidor;
  
     public ServidorPlanificadorStarter(){
         super();
     }
  
     public static void main(String[] args) {
         if (System.getSecurityManager() == null) {
             System.setSecurityManager(new SecurityManager());
         }
         try {
             DatosConexion datos = DatosConexion.getInstance();
  
             ip = datos.getServiceIP(Servidor);
             puerto = Integer.valueOf(datos.getServicePort(Servidor));
             nombreServidor = datos.getServiceName(Servidor);
  
             System.setProperty("java.rmi.server.hostname", ip);
  
             System.out.println("Conectando a:  " + ip + " / " + puerto + " / " + nombreServidor);
  
             InterfazServidorPlanificador engine = new ServidorPlanificadorStarter();
              InterfazServidorPlanificador stub =
                  (InterfazServidorPlanificador) UnicastRemoteObject.exportObject(engine, puerto);
              Registry registry = LocateRegistry.getRegistry();
              registry.rebind(nombreServidor, stub);
              System.out.println("ServidorPlanificador bound");
          } catch (Exception e) {
              System.err.println("ServidorPlanificadorStarter exception:");
              e.printStackTrace();
          }
      }
  
  }
  </code></pre>
  
  <p>The interface is as follows (very basic, as I have done nothing with it)</p>
  
  <pre><code>public interface InterfazServidorPlanificador extends Remote {
  
      //void addObserver(RemoteObserver o) throws RemoteException;
  
  }
  </code></pre>