EJB3 and JCR (Jackrabbit) integration - simple demo application

This simple application shows integration EJB3 with JCR (Apache Jackrabbit implementation)

Application allows manage (create/update/delete) simple text documents in JCR repository

Application has two layers - WEB and EJB

  1. WEB layer Simple web application based on JSF (RichFaces)
  2. EJB Layer Stateless Session Bean with methods - get, put, delete, list. Session Bean access to JCR via JCA interface.
  3. JCR implementation Apache JackRabbit supplied as RAR (resource archive). JackRabbit provides JCA interface.

Build guidelines

1. Unzip sources into directory

You will have next directory structure:

  • ejb3_jcr - Parent project that holds parent pom.xml

  • ejb3_jcr_build - Build project or reactor

  • ejb3_jcr_ear - EAR project

  • ejb3_jcr_ejb - EJB module project

  • ejb3_jcr_war - WAR module project  

2. cd ejb3_jcr_build

3. mvn install

4. check applicatio n ear - ejb3_jcr_ear/target/ejb3_jcr_demo.ear

Installation guidelines

  1. Install JBoss 4.2.2 or above
  2. copy ejb3_jcr_demo.ear into server/default/deploy directory
  3. Download jcr-1.0.jar file from http://repo1.maven.org/maven2/javax/jcr/jcr/1.0/ and copy it into server/default/lib directory
  4. Download jackrabbit-jca-1.4.rar file from http://repo1.maven.org/maven2/org/apache/jackrabbit/jackrabbit-jca/1.4/jackrabbit-jca-1.4.rar and copy it into server/default/deploy directory
  5. Copy jcr-ds.xml file from ejb3_jcr_build/src/main/resources into server/default/deploy directory
  6. Edit this file - change config-property "homeDir" to directory you want put JCR repository
  7. Run guidelines
  8. Start JBoss
  9. Open link http://localhost:8080/ejb3jcr

Application was tested under java 1.5


NOTE: This forum does not allow to attach files like *.zip, so rename attached file ejb3_jcr_demo.gif to ejb3_jcr_demo.zip


Thank you for your interest!

We will contact you as soon as possible.

Send us a message

Oops, something went wrong
Please try again or contact us by email at info@tikalk.com