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

David Legg david.legg at searchevent.co.uk
Thu Nov 20 00:32:54 UTC 2008


Hi All,

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://192.168.1.10/server1 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.

I'm using Sun's Java 1.6 to run both client and server (although I had 
to compile the Java files using Java 1.5 because it won't build with 
Java 1.6).

If I've made a wrong assumption somewhere I'd appreciate a hint.

The exception looks as follows: -

DEBUG [main] (SessionConnection.java:273) - Finding session factory for 
rmi://optimus/server1
log4j:ERROR No output stream or file set for the appender named [null].
DEBUG [main] (SessionFactoryFinder.java:140) - Attempting to connect via RMI
Exception in thread "main" org.mulgara.connection.ConnectionException: 
Unable to connect to a server
    at 
org.mulgara.connection.SessionConnection.setServerUri(SessionConnection.java:284)
    at 
org.mulgara.connection.SessionConnection.<init>(SessionConnection.java:73)
    at 
org.mulgara.connection.SessionConnection.<init>(SessionConnection.java:61)
    at 
org.mulgara.connection.ConnectionFactory.newConnection(ConnectionFactory.java:133)
    at 
com.searchevent.meerkat.mulgara.SparqlTester.main(SparqlTester.java:58)
Caused by: org.mulgara.server.driver.SessionFactoryFinderException: 
Couldn't create session factory for rmi://optimus/server1
    at 
org.mulgara.server.driver.SessionFactoryFinder.newSessionFactory(SessionFactoryFinder.java:179)
    at 
org.mulgara.connection.SessionConnection.setServerUri(SessionConnection.java:275)
    ... 4 more
Caused by: java.net.ConnectException: Connection refused: connect
    at java.net.PlainSocketImpl.socketConnect(Native Method)
    at java.net.PlainSocketImpl.doConnect(PlainSocketImpl.java:333)
    at java.net.PlainSocketImpl.connectToAddress(PlainSocketImpl.java:195)
    at java.net.PlainSocketImpl.connect(PlainSocketImpl.java:182)
    at java.net.SocksSocketImpl.connect(SocksSocketImpl.java:366)
    at java.net.Socket.connect(Socket.java:518)
    at java.net.Socket.connect(Socket.java:468)
    at java.net.Socket.<init>(Socket.java:365)
    at java.net.Socket.<init>(Socket.java:179)
    at 
sun.rmi.transport.proxy.RMIDirectSocketFactory.createSocket(RMIDirectSocketFactory.java:22)
    at 
sun.rmi.transport.proxy.RMIMasterSocketFactory.createSocket(RMIMasterSocketFactory.java:128)
    at sun.rmi.transport.tcp.TCPEndpoint.newSocket(TCPEndpoint.java:595)
    at 
sun.rmi.transport.tcp.TCPChannel.createConnection(TCPChannel.java:198)
    at sun.rmi.transport.tcp.TCPChannel.newConnection(TCPChannel.java:184)
    at sun.rmi.server.UnicastRef.invoke(UnicastRef.java:110)
    at 
org.mulgara.server.rmi.RemoteSessionFactoryImpl_Stub.getDefaultServerURI(Unknown 
Source)
    at 
org.mulgara.server.rmi.RmiSessionFactory.<init>(RmiSessionFactory.java:120)
    at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
    at 
sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:39)
    at 
sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:27)
    at java.lang.reflect.Constructor.newInstance(Constructor.java:513)
    at org.mulgara.util.Reflect.newInstance(Reflect.java:36)
    at 
org.mulgara.server.driver.SessionFactoryFinder.newSessionFactory(SessionFactoryFinder.java:173)
    ... 5 more


Regards,
David Legg


[1] http://mulgara.org/trac/wiki/UserAPI
[2] 
http://mulgara.org/svn/mulgara/tags/release-2.0-alpha-final/tools/src/org/mulgara/tools/Sparql.java



More information about the Mulgara-general mailing list