Java RMI Verbindung Exception: Connection refused to host / timeout

Arbeite ich an einem RMI-command-line-Spiel, aber immer wenn ich versuche, meinen Dienst, den ich erhalten eine Fehlermeldung wie diese:

java.rmi.ConnectException: Connection refused to host: 192.168.56.1; nested exception is: 
    java.net.ConnectException: Connection timed out: connect

Dies ist die Hauptklasse für meine Server:

public class RMIWar {

    public static void main(String[] args) throws RemoteException, MalformedURLException  {
        try {
            Controle obj = new Controle(4);
            Registry reg = LocateRegistry.createRegistry(1099);
            System.out.println("Server is ready");
            reg.rebind("CtrlServ", obj);
        }
        catch (Exception e) {
            System.out.println("Error: " + e.toString());
        }
    }
}

Die wichtigsten für meine Client Klasse:

public class RMIWarClient {
    public static void main(String[] args) throws RemoteException, MalformedURLException, NotBoundException  {
        try {
            Registry registry = LocateRegistry.getRegistry("localhost");
            ControleInt ctrl = (ControleInt) registry.lookup("CtrlServ");
            System.out.println("CtrlServ found...\n");
            BioRMI bio = new BioRMI(null, 5,5,5);
            ctrl.thRegister("Test", bio.atk, bio.def, bio.agi);

        }

        catch (Exception e) {
            System.out.println("Error: " + e);
        }
    }
}

Irgendwelche Vorschläge?

Schreibe einen Kommentar