• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

RMI is driving me nuts!

 
joel smither
Ranch Hand
Posts: 31
  • Mark post as helpful
  • send pies
  • 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...
 
Frans Janssen
Ranch Hand
Posts: 357
  • Mark post as helpful
  • send pies
  • 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.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic