PDA

Archiv verlassen und diese Seite im Standarddesign anzeigen : Hilfe!!!!!!(java)



CrAzY_aDi
12-07-2007, 09:03
Erstmal Hallo euch allen!!

Hab ein großes problem beim RMI(server-client verbindung).
Der erste code is vom Server:


package server;

import java.rmi.Naming;

public class DateServer {
public static void main(String[] args) {

// You may want a SecurityManager for downloading of classes:
// System.setSecurityManager(new RMISecurityManager());

try {
// Create an instance of the server object
RemoteDateImpl im = new RemoteDateImpl();

System.out.println("DateServer starting...");
// Locate it in the RMI registry.
Naming.rebind(RemoteDate.LOOKUPNAME, im);

System.out.println("DateServer ready.");
} catch (Exception e) {
System.err.println(e);
System.exit(1);
}
}
}

und der Fehler-Code lautet:


java.rmi.ConnectException: Connection refused to host: 128.130.68.103; nested exception is:
java.net.ConnectException: Connection refused: connect



würd mich sehr freuen wenn mir jemand helfen würde!! :D

lg adi

Vani
12-07-2007, 10:06
Ich tipp mal auf Firewall ... eventuell die Windows Firewall :)

maosmurf
12-07-2007, 10:11
1) willkommen im BB! :)

2) bitte aussagekräftigere thread titel verwenden... ;)

3) schreib in den catch block mal e.printStackTrace(); ... und schreib dann das ergebnis ins baord.

maosmurf
12-07-2007, 10:19
außerdem: catch (Exception e) is *pfui*... ;)

im try hast eh nur 2 anweisungen.



public static void rebind(String (http://java.sun.com/j2se/1.4.2/docs/api/java/lang/String.html) name, Remote (http://java.sun.com/j2se/1.4.2/docs/api/java/rmi/Remote.html) obj) throws RemoteException (http://java.sun.com/j2se/1.4.2/docs/api/java/rmi/RemoteException.html), MalformedURLException (http://java.sun.com/j2se/1.4.2/docs/api/java/net/MalformedURLException.html) kann gar keine java.rmi.ConenctException werfen, also wirds dein konstruktor sein.

solltest dud as Bsp jedoch direkt von DA (http://www.physik.uni-muenchen.de/kurs/Computing/javaoo/node65.html)abgekupfert haben, schau ob das interface stimmt etc.
wenn du echt alles 1:1 anch deren anleitung gemacht hast, wirds die FW sein.

CrAzY_aDi
12-07-2007, 10:29
Danke für deine Hilfe, werd noch einmal alles durchschaun was noch falsch sein könnte ;)

danke lg adi