Introduction to Java Content Repository and Apache Jackrabbit

Posted on Posted in Java, Technology Center

With the growing demand in integrating content like photos, music, videos and office documents into business and web applications, we need a content management system that is rich in features, flexible and easy to learn. The Java Community Process developed a solution to this trend – the JSR-170 and JSR-283, also known as the Java Content Repository (JCR) API.

The JCR specification provides a unified interface that different vendors can implement to meet the needs of a content management system. Application developers, on the other hand, are saved from learning different propriety APIs, thus, reducing time-to-market. They just need to learn one API that is compatible with any JSR-170/283 compliant repository. This framework is not only vendor neutral. It is also not tied to any particular underlying architecture. The back-end data storage could be a file system, a WEBDAV repository, an XML-backed system or an SQL-based database. In addition to flexibility, the Java Content Repository has a lot more features to offer.

A content repository is like a fusion of a database and a file system. Among the valuable features of this integration are:

  • support for both structured and unstructured content
  • hierarchical design
  • SQL and/or XPath query
  • access control
  • locking
  • full-text search
  • versioning

Everything stored in the repository is managed as NODES and PROPERTIES. For example, in blog repository, we could say that each node of blog entry must have properties like title, author, text article, and file attachments (photo/video). The JCR API has several pre-defined node types like “nt:folder”, “nt:file”, and “nt:unstructured” but developers can also define their custom node types.

repo model

A lot of JCR-compliant repositories are already available in the market. Among them are Day CRX, IBM CM, Oracle XML DB, Alfresco ECM, and Apache Jackrabbit. Let’s explore what Apache Jackrabbit has to offer.

Apache Jackrabbit

Apache Jackrabbit is a fully conforming implementation of the Java Content Repository. It complies with level 1 and 2 of JCR and adds more advanced features. Shown below are the features supported by each level:

Level 1

Level 2


To start developing applications with Apache Jackrabbit, you may download the Jackrabbit web application module from the Apache Downloads, get the JCR specification and javax.jcr package, study the JCR API and use the following model for your repository application:

Webapplication deployment model


Need a partner to deliver a business application? If so, don’t hesitate to contact us today.
Send us a message


For more information, you may visit the Apache Jackrabbit site at

One thought on “Introduction to Java Content Repository and Apache Jackrabbit

  1. Do you have any examples for writing and reading file in JackRabbit ??
    i have to implement it but i do not know how..

Leave a Reply

Your email address will not be published.

This site uses Akismet to reduce spam. Learn how your comment data is processed.