Win a copy of Cross-Platform Desktop Applications: Using Node, Electron, and NW.js this week in the JavaScript forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

RemoteException LOCALHOST is non-localhost  RSS feed

 
colby montgomery
Greenhorn
Posts: 4
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hello RMI gurus,

I am trying to run an example RMI application to get a better understanding of how RMI works, but I have encountered this problem. The error I am getting is this:

Error: RemoteException occured in server thread; nested exception is:
java.rmi.AccessException: Registry.Registry.rebind disallowed;
origin
LOCALHOST/127.0.0.1 is non-local host

I have the rmiregistry running on the default port on the same system that I am trying to run the server side part of the program. Here is how I start the program:

>java -Djava.rmi.server.codebase=file:///java/verify/ -cp /java/verify FibonacciServer

Also, I bind my object to rmi with this call in the FibonacciServer class:
Naming.bind("fibonacci", f);

I am guessing it is choking on this.

Any way...thanks in advance for any help with this!

C.M.
 
Sravan Kumar
Ranch Hand
Posts: 121
  • Likes 1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Are you trying to bind the remote object from a non-local registry? I mean, are the server and the rmiregistry running on different machines? If yes, try using LocateRegistry.getRegistry() to get the registry on the machine on which the rmiregistry is running and call rebind() on that.

You might also want to look .here

By the way, try putting an entry for localhost in /etc/hosts file and then try.
 
colby montgomery
Greenhorn
Posts: 4
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
No, the server and the rmiregistry are on the same machine. I was told to change
Naming.bind("fibonacci", f);
to
Naming.bind("//localhost/fibonacci",f);

..havent had a chance to try it out yet so I cant comment of its effectiveness.

C.M.
 
Nathan Pruett
Bartender
Posts: 4121
IntelliJ IDE Java Spring
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
"C. M." -

Welcome to the JavaRanch! Please adjust your displayed name to meet the
JavaRanch Naming Policy. User names cannot be obviously fake and must constist of a first name and a last name.

You can change your user name here.

Back to the question - if you're running on a Linux system, make sure your /etc/hosts file contains the line :


Anything "special" about the network setup of the machine you're trying to run on? Multiple network cards?

Thanks! and welcome to the JavaRanch!
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!