This document describes how to use a Jackrabbit content repository in the deployment model 3: The Repository Server. In this deployment model, a separate repository server is running outside the virtual machine the client application is running in. A repository server can serve multiple applications running on separate JVMs on separate network hosts. See the JCR client application HOWTO for instructions on how to use the configured content repository server.
Note that JCR specification defines no standard communication
protocol for inter-JVM repository access, and that Jackrabbit
supports no such protocol by default. However, the Jackrabbit
contrib
subdirectory contains tools for using JCR
content repositories over the RMI and Webdav protocols (see the
jcr-rmi
and jcr-server
contrib packages).
This how-to contains instructions for accessing a JCR-RMI server in Tomcat versions 4.x and 5.x. It should be easy to modify the instructions for other container environments and communication protocols.
In addition to the following the instructions in this document, you also need to have an already running JCR-RMI server. See the JCR-RMI javadocs for instructions on how to setup such a server.
Warning: The current JCR-RMI library is designed for simplicity, not performance. You will probably experience major performance issues if you try running any non-trivial applications on top of JCR-RMI.
Follow the steps below to setup a model 3 JCR-RMI client deployment for your web application in Tomcat 4.x or 5.x. Example code for both versions of Tomcat is included after this overview.
Note that these instructions closely follow the Model 1 HOWTO instructions. By making similar changes (change the factory class and parameters of the repository) to the Model 2 HOWTO instructions, you can setup a shared JCR-RMI client deployment for all applications in the container.
[Tomcat folder]/webapps/[your app]/WEB-INF/lib
.
You can find the jcr-rmi implementation under the contrib
folder of the Jackrabbit source distribution.