Ibrahim.I
Ibrahim.I

Reputation: 329

rmi registry binding issue

I'm running RMI Regitry on a virtual machine (running Windows XP) with IP: 192.168.133.2 and trying to bind an RMI server (running on different vm XP IP: 192.168.133.3) by using this code:

Naming.rebind("//192.168.133.2/rmi.2", new RMI());

where

public class RMI extends UnicastRemoteObject

but I get this exception:

    java.rmi.AccessException: Registry.Registry.rebind disallowed; origin /192.168.133.3 is non-local host

I figured that the RMI Registry don't accept any rmi server which isn't running on the same RMI Registry running machine.

but how to make this registry accept my rmi server?

p.s: I'm using JBuilder X as an IDE.

I'm trying to implement a mobile agent which will run on some rmi servers to do some work on them and return the results to the starting station so RMI servers implements the environment that hosts this agent to do its work and send it to the next station which it'll locate through the registry

Upvotes: 3

Views: 10794

Answers (2)

user207421
user207421

Reputation: 311052

trying to bind an RMI server (running on different vm XP IP: 192.168.133.3)

Stop right there. You can't do that. You can only bind an RMI server to a Registry running in the same host as the agent that is doing the bind.

Note that that does not necessarily mean the same host as the remote object itself is running in. For example, a client could lookup a remote Registry and bind the stubs retrieved into the local Registry. But you cannot bind anything to a remote Registry.

Upvotes: 4

Richard Sitze
Richard Sitze

Reputation: 8463

RMI doesn't provide any sort of "federated" or distributed naming service.

RMI is structured to allow you to run an RMI registry on your server. It hosts services that can be accessed across the network, however the services run locally on that server.

The service being provided must be started - and "rebind" - on the server - not on any client system. Local address only.

Your clients should then reach out to that server...

Upvotes: 1

Related Questions