jackrabbit-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Jukka Zitting <jukka.zitt...@gmail.com>
Subject Re: JNDI and Jackrabbit
Date Sun, 23 Aug 2009 11:44:20 GMT
Hi,

On Sun, Aug 23, 2009 at 11:47 AM, kbar<whereiskent@gmail.com> wrote:
> Now I have another application written in java on the same machine that
> jackrabbit is running on. I would like to talk to jackrabbit from that
> machine. I believe this is possible using JNDI. Is this possible?

Not the way you try to do it. Instead of trying to configure JNDI, use
the JCR-RMI layer directly.

The easiest way to do that is to add the jackrabbit-jcr-rmi jar to
your client application and use the URLRemoteRepository class, like
this:

    import org.apache.jackrabbit.rmi.repository.URLRemoteRepository;

    Repository repository = new
URLRemoteRepository("http://localhost:8080/jackrabbit/rmi");

If you really like, you can also configure the RMI endpoint as a JNDI
resource, but IMHO that's only useful in complex container
environments.

BR,

Jukka Zitting

Mime
View raw message