I m trying to create hello world example using rmi but till not succeeded.I got error in server file "Server Error java.rmi.ConnectException: Connection refused to host: 192.168.1.5; nested exception is: So please help me out.
public class Server implements Hello
{
public String sayHello()
{
return "Hello World!";
}
public static void main(String arg[])
{
try
{
Server obj = new Server();
Hello stub = (Hello)UnicastRemoteObject.exportObject(obj,0);
Registry registry = LocateRegistry.getRegistry();
registry.bind("Hello",stub);
System.err.println("Server Ready");
}
catch(Exception e)
{
System.err.println("Server Error:"+e.toString());
}
}
}