Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

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

like image 601
Ibrahim.I Avatar asked Apr 14 '26 19:04

Ibrahim.I


2 Answers

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.

like image 189
user207421 Avatar answered Apr 16 '26 07:04

user207421


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...

like image 45
Richard Sitze Avatar answered Apr 16 '26 07:04

Richard Sitze



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!