i know at least a few folks here use spring with jackrabbit, so i'm
asking this question here first in hopes that somebody has already
solved the problem.
i'm using spring's JndiObjectFactoryBean to obtain the Repository i've
set up as a naming resource in tomcat.
since updating to the latest jackrabbit source, i'm finding that a
normal server shutdown does not cause the repository to be shutdown. the
repository lock file is not removed, and i can not successfully reopen
the repository when restarting tomcat.
i tried using a destroy method on my bean (see below), but i got an
error from DefaultListableBeanFactory that "Couldn't find a destroy
method named 'shutdown' on bean with name 'jcrRepository'".
<bean id="jcrRepository"
class="org.springframework.jndi.JndiObjectFactoryBean"
destroy-method="shutdown">
<property name="jndiName">
<value>jcr/cosmo</value>
</property>
<property name="resourceRef">
<value>true</value>
</property>
</bean>
destroy-method works fine in my test environment, where i instantiate
RepositoryImpl directly.
<bean id="jcrRepositoryConfig"
class="org.apache.jackrabbit.core.config.RepositoryConfig"
factory-method="create">
<constructor-arg type="java.lang.String" index="0">
<value>@CONFIGFILEPATH@</value>
</constructor-arg>
<constructor-arg type="java.lang.String" index="1">
<value>@REPOSITORYHOMEDIRPATH@</value>
</constructor-arg>
</bean>
<bean id="jcrRepository"
class="org.apache.jackrabbit.core.RepositoryImpl"
destroy-method="shutdown">
<constructor-arg>
<ref local="jcrRepositoryConfig"/>
</constructor-arg>
</bean>
any suggestions? i *really* don't want to have to write a servlet
context listener to shut jackrabbit down. i have thus far managed to
keep jackrabbit-specific code out of the webapp and would like to keep
it that way.
thanks!