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

Life is hard, and then you die ronald at innovation.ch
Thu Nov 20 00:45:27 UTC 2008

On Thu, Nov 20, 2008 at 12:32:54AM +0000, David Legg wrote:
> I'm having trouble getting a test program to talk to a remote Mulgara 
> repository and wondered if anyone has any suggestions.
> The test program is based on the one mentioned on the Wiki [1] and 
> explicitly located here [2]
> This is my first attempt to use the ConnectionFactory and it looks like 
> it is falling over somewhere in the call to 
> org.mulgara.connection.ConnectionFactory.newConnection().  I'm using the 
> latest revision from SVN (revision 1378) on the server side and an 
> identical set of jar files on the client side.
> Thinking that perhaps I've got the wrong URL I've tried all sorts of 
> combinations from rmi://optimus:1099/server1 to 
> rmi:// but it makes little difference to the 
> result.  I've disabled firewalls and I've even run telnet to see if I 
> could access the remote port (which I could).  I've also run netstat -l 
> on the remote (Ubuntu) server and it lists something listening on port 
> 1099 (well, actually it says :::1099 which makes me think it is an IPv6 
> port).  I know the server is working because I can see the web interface 
> if I view http://optimus:8080 either locally on the server or remotely 
> from my laptop.
> DEBUG [main] (SessionConnection.java:273) - Finding session factory for rmi://optimus/server1
> Caused by: java.net.ConnectException: Connection refused: connect
>     at java.net.Socket.<init>(Socket.java:179)
>     at sun.rmi.transport.proxy.RMIDirectSocketFactory.createSocket(RMIDirectSocketFactory.java:22)

Note that RMI uses several ports, not just 1099 one. Specifically,
it'll connect to registry on 1099 first to get the client stubs, but
then it'll use random ports to actually do the RMI calls. Now, you say
you've disabled firewalls, does that mean you have _all_ ports (all
the way up to 65000) open?

A couple suggestions:

 1. Try starting mulgara with '--rmiobjectport 1099'  (i.e. can be the
    same port as used for the registry) - this will cause the actual
    RMI calls to use port 1099 too.
 2. Fire up wireshark (or whatever your favorite snooper is) and see
    what it's trying to connect to that is failing.



More information about the Mulgara-general mailing list