Routing problem with RMI Registry

A

acamposr

Hello. I have a RMI registry listening on port 1099, but no one but
localhost can connect to it. I have mapped my router port 1099 to the
IP where the RMI server is running... What may be wrong?

Thanks!
 
D

Domagoj Klepac

Hello. I have a RMI registry listening on port 1099, but no one but
localhost can connect to it. I have mapped my router port 1099 to the
IP where the RMI server is running... What may be wrong?

I don't know, but I've found that it's usually more convenient to
start RMI registry from within my program (and shut it down after I'm
done) through LocateRegistry.createRegistry(). I think that running
command-line RMI registry doesn't support SSL, while programatically
you can do something like:

Registry rmiRegistry = LocateRegistry.createRegistry(port, new
SslRMIClientSocketFactory(), new SslRMIServerSocketFactory(null, null,
true));

Also, to avoid registry thread running after your application exists,
don't forget to unexport the RMI registry during shutdown if you're
starting it from your application:

UnicastRemoteObject.unexportObject(rmiRegistry, false);

That's, of course, if you're not exiting with System.exit(0).

Domchi
 
A

acamposr

I don't know, but I've found that it's usually more convenient to
start RMI registry from within my program (and shut it down after I'm
done) through LocateRegistry.createRegistry(). I think that running
command-line RMI registry doesn't support SSL, while programatically
you can do something like:

Registry rmiRegistry = LocateRegistry.createRegistry(port, new
SslRMIClientSocketFactory(), new SslRMIServerSocketFactory(null, null,
true));

Actually I do this:

Registry registry = LocateRegistry.createRegistry(1099);
 
D

Domagoj Klepac

Actually I do this:

Registry registry = LocateRegistry.createRegistry(1099);

Check the firewalls, router configuration, etc. How many IPs does your
server have? On which of them is RMI registry listening? Maybe there
is something else already binding to the 1099 on the server's network
IP.

Have you set security manager before creating registry?

Domchi
 
D

dimitar

This is a limitation by design (it's somewhere in the javadoc). Sun
recommends to use LDAP, Jini Registrar or SLP for network-wide service
location.

That speaking, it's not that hard to create your own implementation of
the NamingService and export it manually (I think I have the code
somewhere, let me know if you need it.)

Dimitar
 
E

EJP

dimitar said:
This is a limitation by design (it's somewhere in the javadoc). Sun
recommends to use LDAP, Jini Registrar or SLP for network-wide service
location.

No, that's the limitation where you can only bind to a local registry.
The OP's problem is that *nobody* can *connect* to the registry.

OP: can you ping the Registry host from all the relevant machines? Can
you telnet to port 1099 or port 7 on the Registry host from those
machines? This is sounding like a network topology/configuration problem.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,744
Messages
2,569,484
Members
44,903
Latest member
orderPeak8CBDGummies

Latest Threads

Top