[Mulgara-general] Can't connect to remote Mulgara repository using ConnectionFactory

Alex Hall alexhall at revelytix.com
Thu Nov 20 23:11:03 UTC 2008


David Legg wrote:
>> This reminds me of another issue I've experienced in the past.  RMI connections
>> with a Mulgara server tend not to work unless the hostname on the server is
>> properly set (can be easily verified using the Linux 'hostname' command).  The
>> hostname needs to be a real hostname (not "localhost") which resolves to the
>> external interface (not the loopback address).  Otherwise RMI connections from
>> remote machines won't work; I'm not sure if this is a problem with the
>> canonicalization of server names that Mulgara does, or is deeper in Java RMI.
>>   
> 
> Running 'hostname' on the Linux server correctly returns 'optimus'.  I 
> had an issue a while ago with optimus not seeing the windows machines on 
> the network because of the lack of a DNS but the solution was to run 
> winbind which makes use of netbios calls to find their names.  I suppose 
> something in RMI might assume there is a DNS service?

It's hard to say, because the InetAddress class in Java uses some unspecified
heuristic to resolve hostname to IP address (I believe this is the relevant
class).  The way the problem manifested itself for me was, in response to a
client request to the RMI registry, a packet was sent to the client containing
the address used to talk to the RMI object.  When the server's hostname wasn't
set up properly, the address that got sent back to the client was the loopback
address 127.0.0.1, and the client wound up trying to connect to itself rather
than the server.  If you can see the actual contents of the RMI packets, you
might be able to decipher this (it's mostly binary data but you can make out
classnames and IP addresses in the ASCII serialization).

Regards,
Alex



More information about the Mulgara-general mailing list