Win a copy of Design for the Mind this week in the Design forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Exception in RMI program

 
Siddharth Bhargava
Ranch Hand
Posts: 280
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi all,

I am running the following simple code for RMI

MyRemote.java



MyRemoteImpl.java



MyRemoteClient.java


client.policy



I am getting the following exception every time.



Please help me as I am unable to proceed further and I have tried searching the net also but of no avail.

Please Help !!!

Thanks in advance
 
Vivek Kr Singh
Ranch Hand
Posts: 56
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
at java.rmi.Naming.rebind(Unknown Source)
at com.example.rmi.MyRemoteImpl.main(MyRemoteImpl.java:38)

Is your rmiregistry running ?
 
Siddharth Bhargava
Ranch Hand
Posts: 280
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi Vivek,

My RMI Registry is running. I always run it before executing the program. Still its giving the exception




again and again.

Thanks
Siddharth.
 
Vivek Kr Singh
Ranch Hand
Posts: 56
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
try using this on JDK 1.5

java.rmi.ConnectException: Connection refused to host: hostname; nested exception is:

You must be running server code on same machine on which RMI registry is running. Client code can be executed from any machine provided the skeleton is available.

 
Siddharth Bhargava
Ranch Hand
Posts: 280
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi Vivek,

I am using JDK 1.5 and tried the code given by you as well, namely :



But now I get the following exception :


Currently all my code is running on my desktop.

Do we really need skeleton in JDK 1.5 ?

Please Help me get over this problem I am very very upset

Thanks
Siddharth

 
Vivek Kr Singh
Ranch Hand
Posts: 56
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Suggest you to read Sun's RMI Hello World Page
 
Siddharth Bhargava
Ranch Hand
Posts: 280
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi Vivek,

Problem was solved.

There was a code change which was to be done.


Thanks
Siddharth
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic