Ciao ho compilato InterfacciaRMI ed è tutto ok;
ma se compilo la SERVERMI mi dà errore sulla riga dove faccio "class SERVERMI extends UnicastRemoteObject implements InterfacciaRMI" segnalandomi in particolare InterfacciaRMI
Secondo te perchè ?
A me sembra di capire come se SRVERMI fosse visto nel package(mio) e invece InterfacciRMI no.
Ti invio il mio sorgente del server (SERVERMI);volevo ricordarti che comunque sto usando JBUILDER per scrivere il codice però ho comunque compilato come tu mi hai suggerito con javac.Questo il codice
package mio;
/**
*
Title: </p>
*
Description: </p>
*
Copyright: Copyright (c) 2004</p>
*
Company: </p>
* @author not attributable
* @version 1.0
*/
import java.net.MalformedURLException;
import java.rmi.*;
import java.rmi.server.*;
class SERVERMI extends UnicastRemoteObject implements InterfacciaRMI
{
public SERVERMI() throws RemoteException {
super();
}
public String getMessaggio(String s) throws RemoteException {
return "Prova";
}
public static void main(String[] args){
try{
SERVERMI server = new SERVERMI();
Naming.rebind("InterfacciaRMI",server);
System.out.print("Server avviato");
}catch(MalformedURLException mue){
System.out .print(mue);
}catch(UnknownHostException uhe){
System.out .print(uhe);
}catch(RemoteException re){
System.out .print(re);
}
}
}
Ciaooo![]()