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

Signature
Ouroboros ltd. - http://www.ouroboros.hr
Antispam: to reply, remove extra monkey from reply-to address.
acamposr@gmail.com - 15 May 2006 15:19 GMT
>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
[quoted text clipped - 5 lines]
>SslRMIClientSocketFactory(), new SslRMIServerSocketFactory(null, null,
>true));
Actually I do this:
Registry registry = LocateRegistry.createRegistry(1099);
Domagoj Klepac - 16 May 2006 09:32 GMT
>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

Signature
Ouroboros ltd. - http://www.ouroboros.hr
Antispam: to reply, remove extra monkey from reply-to address.
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
EJP - 17 May 2006 08:06 GMT
> 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.