Good day everybody! I have problem, with my RMI example. Week ago, i try to start my first example of RMI, and it's worked, but i delete project, and try to create again, but i can't,cos' throw ExportException. What did i do wrong? Maybe i need to restart rmiregistry.exe or something else?
public interface IExample extends Remote {
public String getMessage(String input) throws RemoteException;
}
public class ExampleImpl extends UnicastRemoteObject implements IExample {
public ExampleImpl() throws RemoteException {
super();
}
@Override
public String getMessage(String input) throws RemoteException {
return "Hi " + input + "!!!";
}
public static void main(String... args) throws RemoteException, MalformedURLException {
System.setSecurityManager(new RMISecurityManager());
String name = "myexample";
IExample engine = new ExampleImpl();
IExample stub =
(IExample) UnicastRemoteObject.exportObject(engine, 1090);
Registry registry = LocateRegistry.getRegistry();
registry.rebind(name, stub);
}
}
P.s. Thx for all and sorry for my English. P.p.s. and for my stupid question.