This week's book giveaway is in the HTML Pages with CSS and JavaScript forum.
We're giving away four copies of Testing JavaScript Applications and have Lucas da Costa on-line!
See this thread for details.
Win a copy of Testing JavaScript Applications this week in the HTML Pages with CSS and JavaScript forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Bear Bibeault
  • Ron McLeod
  • Jeanne Boyarsky
  • Paul Clapham
Sheriffs:
  • Tim Cooke
  • Liutauras Vilda
  • Junilu Lacar
Saloon Keepers:
  • Tim Moores
  • Stephan van Hulst
  • Tim Holloway
  • fred rosenberger
  • salvin francis
Bartenders:
  • Piet Souris
  • Frits Walraven
  • Carey Brown

Exception in RMI program

 
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
 
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
 
If we don't do the shopping, we won't have anything for dinner. And I've invited this tiny ad:
Thread Boost feature
https://coderanch.com/t/674455/Thread-Boost-feature
    Bookmark Topic Watch Topic
  • New Topic