0

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());
         }

     }

}

Edited by ~s.o.s~: edited title

2
Contributors
1
Reply
2
Views
5 Years
Discussion Span
Last Post by ~s.o.s~
0

Post the entire stacktrace. Also, which tutorial are you referencing when writing your RMI programs? Do you have sufficient permissions to bind to the port 1099 (default rmiregistry port)?

Edited by ~s.o.s~

This topic has been dead for over six months. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.