jackrabbit-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Mihai Anescu" <mane...@totalsoft.ro>
Subject RE: RMI connection
Date Wed, 05 Sep 2007 13:57:47 GMT
Hello,

I tried some time ago to do the same thing (one month ago, on JR 1.3.0).
I hope it helps. This would be a client app that connect via RMI to the
repository on a JBoss 4.2.0 repository...

The path I used was, but the rest I suppose is the same:
jnp://localhost:1099/jcrServer

Apparently, when connecting remote, via RMI, there is a whole set of
classes defined just for that (RemoteSession, RemoteWorkspace,
RemoteRepository). 

Here is the code I used to connect via RMI:

            RemoteSession session = getSession();
            RemoteWorkspace work = session.getWorkspace();


    private static RemoteSession getSession() throws Exception {
        log.info("#begin of getSession");

        Credentials cred = new SimpleCredentials("user",
"pwd".toCharArray());
        RemoteSession session = null;

        Properties properties = new Properties();
        properties.put(Context.INITIAL_CONTEXT_FACTORY,
"org.jnp.interfaces.NamingContextFactory");
        properties.put(Context.URL_PKG_PREFIXES,
"org.jboss.naming:org.jnp.interfaces");
        properties.put(Context.PROVIDER_URL, "localhost:1099");
        InitialContext ctx = new InitialContext(properties);

        Object obj = ctx.lookup("jnp://localhost:1099/jcrServer");

        RemoteRepository repo = (RemoteRepository) obj;
        session = repo.login(cred);

        log.info("#end of getSession");
        return session;
    }


-----Original Message-----
From: stefan81 [mailto:stefan.schlappa@process-relations.com] 
Sent: Wednesday, September 05, 2007 4:50 PM
To: users@jackrabbit.apache.org
Subject: Re: RMI connection


Hi,

as it seems, I face the same problems like Marcel. I also get the
following
exception when trying to access the repository on JBoss via RMI by
rmi://localhost:1099/jcrServer:

non-JRMP server at remote endpoint

Are there any new insights which might help me with the problem? 


Marcel Dullaart-2 wrote:
> 
> Hi all,
> 
> I have setup a JBoss server instance and placed the
> jackrabbit-jca-1.2.3.rar and jackrabbit-jcr-rmi-1.2.3.jar in its
> deploy directory. From the, I removed the jcr-1.0.jar from
> jackrabbit-jca-1.2.3.rar and placed it in the server's lib diretory,
> also have I created a datasource connector (*-ds.xml) file and placed
> that in the deploy directory as well.
> JBoss start fine without errors.
> 
> Then I tried to connect to it using the jcrClient (contrib), using
> jndi jcrServer, which succeeded.
> But I need an RMI connection so in the jcrClient I tried connect
> rmi://localhost:1099/jcrServer. This failed with the message:
> exception: java.rmi.ConnectIOException
> message: non-JRMP server at remote endpoint
> 
> When using the jcrBrowser plugin from eclipse I get the same results.
> 
> Can someone please explain to me what is wrong here?
> 
> 
> Thanks in advance,
> Marcel
> 
> 

-- 
View this message in context:
http://www.nabble.com/RMI-connection-tf3611478.html#a12498460
Sent from the Jackrabbit - Users mailing list archive at Nabble.com.


Mime
View raw message