We're a community of 1077K IT Pros here for help, advice, solutions, professional growth and fun. Join us!
1,076,355 Members — Technology Publication meets Social Media
Username:
Password:
Lost login information?
Start New Discussion Reply to this Discussion

RMI Server Error

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

     }

}
2
Contributors
1
Reply
2 Days
Discussion Span
1 Year Ago
Last Updated
2
Views
falcon221
Newbie Poster
1 post since Dec 2010
Reputation Points: 10
Solved Threads: 0
Skill Endorsements: 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)?

~s.o.s~
Failure as a human
Administrator
12,220 posts since Jun 2006
Reputation Points: 3,307
Solved Threads: 783
Skill Endorsements: 55

This article has been dead for over three months: Start a new discussion instead

Post: Markdown Syntax: Formatting Help
 
You
 
© 2013 DaniWeb® LLC
Page rendered in 0.0608 seconds using 2.7MB