Shared J2EE Resource HOWTO
This document describes how to use a Jackrabbit content repository in the deployment model 2: Shared J2EE Resource. In this deployment model, a central content repository resource managed by an application server is used by multiple different applications. See the JCR client application HOWTO for instructions on how to use the configured content repository.
This how-to contains instructions for Tomcat versions 4.x and 5.x. It should be easy to modify the instructions for other container environments.
Follow the steps below to setup a model 2 Jackrabbit deployment for your Tomcat 4.x or 5.x installation. Example code for both versions of Tomcat is included after this overview.
- Place the Jackrabbit jar file and all the dependencies (including the JCR API jar file) under Tomcat folder/common/lib.
- Register the bindable repository factory as a global resource.
- Link the global resource to a context scoped JNDI address.
Note: This step is essentially the same as step 2 in the Model 1 HOWTO. The only differences are in the (arbitrary) naming of the resource and placing of the configuration elements. The difference in the end result is that the configured repository is bound to the global JNDI context instead of a local one. In Tomcat 4.x and 5.0, add the following snippet in server.xml under the GlobalNamingResources element.
In Tomcat 5.5, add the following snippet in server.xml under the GlobalNamingResources element.
In Tomcat versions 4.x and 5.0, add the following snippet in server.xml under the Context element of your web application. In Tomcat version 5.5, add the snippet in your application's context.xml or $CATALINA_HOME/conf/enginename/hostname/webappname.xml. If you prefer central configuration, you can add the configuration to $CATALINA_HOME/conf/context.xml.