Lei Zhou wrote:
Due to deployment issues (can't use BindableRepository as jndi resource due to class path conflict with the server), I loaded Jackrabbit classes and my content managing service JAR file from the EAR root, and used RepositoryImpl directly. In my initialization code, I used similar Runtime hook as the BindableRepository to ensure the shutdown method was invoked. As you've mentioned in Jira entries jcr-120 and jcr-57, it seems to me that the shutdown hook is invoked too late in the process. I may need to find another way/place to ensure the shutdown is invoked. Any suggestion?
you could implement a ServletContextListener where you start and stop the repository. or use a simple servlet where you implement the init() and destroy() methods.
For an example see: http://svn.apache.org/repos/asf/jackrabbit/trunk/jackrabbit-webapp/src/main/java/org/apache/jackrabbit/j2ee/RepositoryStartupServlet.java
regards marcel
