jackrabbit-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Edgar Poce <edgarp...@gmail.com>
Subject Re: How to call RepositoryImpl.shutdown() when using RegistryHelper
Date Thu, 17 Feb 2005 14:50:30 GMT
Hi francis

> I use Jackrabbit API from JSPs under Tomcat 5.5.7 and
> i don't know if hooks are called when processing JSPs
> (i don't know how hooks work). I'll google the web but
> if someone have the solution, it would be nice to post
> it here.
You can delegate on the container the jackrabbit lifecycle through j2ee 
JNDI Resources. Tomcat will take care of jackrabbit startup and the hook 
will take care of shutting it down when you stop tomcat.
Just don't kill the jvm process and it should work ok.

You have to register jackrabbit in the JNDI env.


   <ResourceParams name="jcr/repositoryFactory">
       <value>[path to repository.xml]</value>
       <value>[path to repository folder]</value>

and you will be able to get the repository with this code

   InitialContext ctx = new InitialContext();
   Context env = (Context) ctx.lookup("java:comp/env");
   Repository o = (Repository) env.lookup("jcr/repositoryFactory");


View raw message