• 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 Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Tim Cooke
  • paul wheaton
  • Liutauras Vilda
  • Ron McLeod
Sheriffs:
  • Jeanne Boyarsky
  • Devaka Cooray
  • Paul Clapham
Saloon Keepers:
  • Scott Selikoff
  • Tim Holloway
  • Piet Souris
  • Mikalai Zaikin
  • Frits Walraven
Bartenders:
  • Stephan van Hulst
  • Carey Brown

RMI is driving me nuts!

 
Ranch Hand
Posts: 31
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Can anybody help me with RMI? I'm supposed to set up RMI without the installation of a security manager. I'm running on Windows 98.

If someone could show me the code for the client and server portions, I'd be forever greatful...

Here's the basics of my server process:
Registry myRegistry = LocateRegistry.createRegistry(Integer.parseInt(port));
RemoteUrlyBirdDBAccess dbServer = new DataAdapterImpl(dbpath);
String serverObjName = "rmi://" + host + ":" + port + "/"
+ RMI_SERVICE_NAME;
myRegistry.rebind(serverObjName, dbServer);

Here's the basics of my client...
lookupString = "rmi://" + host + ":" + port + "/"
+ RMI_SERVICE_NAME;
RemoteUrlyBirdDBAccess remote =
(RemoteUrlyBirdDBAccess) Naming.lookup(lookupString);


I start the server first, then I strat the client. The client gets a NotBoundException...I can't figure out what I'm doing wrong.

I see articles on the net, that I have to run the rmiregistry program, what is that?

HELP...
 
Ranch Hand
Posts: 357
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi Joel,

I am not an RMI expert, but I encountered the same problems as you are experiencing. After some fiddling around I found a solution that worked for me: to leave out the host address in the server (it should be the localhost anyway).

I use the following lines of code to set-up the server:


The client does this:


Hope this helps,

Frans.

P.S. if I put "rmi://" in the servers call to rebind() it does not work, although I do not yet understand why.
 
A lot of people cry when they cut onions. The trick is not to form an emotional bond. This tiny ad told me:
Smokeless wood heat with a rocket mass heater
https://woodheat.net
reply
    Bookmark Topic Watch Topic
  • New Topic