jackrabbit-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Vikas Bhatia" <vik...@gmail.com>
Subject cannot login to remote repository
Date Tue, 19 Sep 2006 15:57:13 GMT

I am trying to login to a remote repository using a rmi client. I know that
port 1099 on the remote machine is accepting connection and there are no
firewall issues but my code fails at
session = repository.login (credentials, "testrep");

I can telnet to the port 1099 on the remote machine.

The trace message is
org.apache.jackrabbit.rmi.client.RemoteRepositoryException: Connection
refused to host:; nested exception is:
    java.net.ConnectException: Connection refused: connect: Connection
refused to host:; nested exception is:
    java.net.ConnectException: Connection refused: connect
    at org.apache.jackrabbit.rmi.client.ClientRepository.login(
    at com.co.cd.samples.Importer.main(Importer.java:223)

It seems that the client is trying to connect to the local machine for some
On debugging this is what I see in the ServerRepository_Stub remote instance
"ServerRepository_Stub[UnicastRef [liveRef:

So the remote repository is getting bound to Is this a bug or am
I missing something?

The java file is pasted below

import java.net.MalformedURLException;
import java.rmi.NotBoundException;
import java.rmi.RemoteException;

import javax.jcr.Credentials;
import javax.jcr.Repository;
import javax.jcr.RepositoryException;
import javax.jcr.Session;
import javax.jcr.SimpleCredentials;
import javax.naming.NamingException;

import org.apache.jackrabbit.rmi.client.ClientRepositoryFactory;

public class RemoteRepLogin {
    private static final String REPO_NAME =

    private static final String USERID = "admin";

    private static final char[] PASSWORD = "pwd".toCharArray();

    private static Repository repository;

    private static Session session;

    private static Repository getRepository() throws NamingException,
            RepositoryException, ClassCastException, MalformedURLException,
            RemoteException, NotBoundException {
        String name = REPO_NAME; // The RMI URL of the repository
        ClientRepositoryFactory factory = new ClientRepositoryFactory();
        Repository repository = null;
        repository = factory.getRepository(name);
        return repository;

    public static void main(String[] args) {
        try {
            repository = getRepository();
            Credentials credentials = new SimpleCredentials(USERID,
            session = repository.login(credentials, "testrep"); //exception
thrown here...
            System.out.println("Got session="+session);
        } catch (Exception e) {
            System.out.println("Yargg - an exception.");



  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message