我需要你的幫助,圍繞JAVA RMI,我開發了一個示例程序來對錶進行排序。但我得到這個異常:java.rmi.UnmarshalException:錯誤解組參數;嵌套的異常是:java.lang.ClassNotFoundException:ServicesTableau
Erreur RemoteException occurred in server thread; nested exception is:
java.rmi.UnmarshalException: error unmarshalling arguments; nested exception is:
java.lang.ClassNotFoundException: ServicesTableau
,這是我的服務器的源代碼:
public class Serveur {
public static void main(String args[]) {
try {
System.out.println("Server start ...");
ServicesTableauImpl od = new ServicesTableauImpl();
String url = "rmi://" + args[0] + "/ServicesTableauImpl";
System.out.println("Passe");
Naming.rebind(url, od);
System.out.println("Attente d'invocations de client/CTRL-C pour stopper");
} catch (Exception e) {
System.out.println("Erreur " + e.getMessage());
}
/*
catch(java.net.MalformatedURLException e){
System.out.println("Mauvais nom de serveur");
System.exit(1);
}
catch(RemoteException e){
System.out.println("Pas de Rmiregistry");
System.exit(1);
}
*/
}
}
這個類ServicesTableauImpl在類路徑中可用嗎? –