epesh
I'm Joseph Ottinger, editor of TheServerSide.com.

Calendar

««Nov 2009»»
SMTWTFS
1234567
891011121314
15161718192021
22232425262728
2930

My Bookmarks

My Top Tags

                                       

Mailing List

My RSS Feeds








Search Box

 

Jackrabbit and Glassfish V2

posted Friday, 22 September 2006
Setting up Jackrabbit's shared deployment model in Glassfish is trivial. Here's how I did it, and good on the Jackrabbit people for actually making it easy to log in.
  • First, copy all of the jackrabbit dependencies to $GLASSFISH/domains/$DOMAINNAME/lib/ext/. The list: commons-collections-3.1.jar, jackrabbit-core-1.1-SNAPSHOT.jar, jcr-1.0.jar, slf4j-jdk14.jar, concurrent-1.3.4.jar, jackrabbit-index-filters-1.0.1.jar, and lucene-1.4.3.jar.
  • In the Glassfish administration console, open up "Resources/JNDI/Custom Resources."
  • Put in a JNDI name; I used "jcr/repository".
  • For resource type, I used "javax.jcr.Repository".
  • For the factory class, I used "org.apache.jackrabbit.core.jndi.BindableRepositoryFactory".
  • Create two properties:
    • configFilePath, pointing to a configuration XML file with an absolute path on the server. I used the example configuration file verbatim.
    • repHomeDir pointing to the absolute filesystem path for the repository. (Note that this might be different depending on the configuration settings. For example, if you use a search engine and a repository that only use a database, you might not use the filesystem at all.
Now, you can set up JNDI references to jcr/repository and use JCR to manage content in your application server.

tags:        




1. ruchi left...
Wednesday, 18 October 2006 3:07 am

Does this work for SUN Java System Application Server 8.x I followed the same procedure , restarted my appserver but I am not able to see the repository registered with the following directories under repHomeDir : meta,namespaces,nodetypes

I observer similar behaviour in Tomcat when the jackrabbit jars were placed at wrong location . Do u think this need to be changed for SUn Appserver


2. vincent left...
Wednesday, 17 January 2007 12:56 pm

On SJSAS 9,

If I deploy my project with this code,

  • InitialContext ctx = new InitialContext ();

  • Repository repo = null;

  • repo = (Repository) ctx.lookup ("jcr/repository");

  • Credentials cred = new SimpleCredentials ("user",new char[]{'p','w','d'});

  • Session s = repo.login (cred);

  • Node rn = s.getRootNode ();

  • log.info (">> " + rn);

  • s.logout ();

  • ctx.close ();

It works... but when I redeploy, an exception is throw :

NAM0004: Exception during name lookup : {0} java.nio.channels.OverlappingFileLockException

  • at sun.nio.ch.FileChannelImpl $SharedFileLockTable.checkList(FileChannelImpl.java:1173)

  • at sun.nio.ch.FileChannelImpl$SharedF ileLockTable.add(FileChannelImpl.java:1075)

...


3. Erasmus left...
Tuesday, 24 April 2007 12:58 pm :: http://slouchingtowardserfdom.blogspot.c

This installation appears to be a great deal more than trivial. As long as users have to name their own unique types and classes before defining new properties, this is never going to get out to the mainstream of its intended users.


4. DB left...
Friday, 24 August 2007 9:53 am

I have the same locking-problems as vincent has... does anybody have a solution?