Sometimes, the internal datastructure of jackrabbit can become inconsistent. A node references a child that no longer exists. Indexing such a node will lead the errormessages like
Jun 10, 2008 11:10:11 AM org.apache.jackrabbit.core.RepositoryImpl initStartupWorkspaces
SEVERE: Failed to initialize workspace 'wm9'
javax.jcr.RepositoryException: Error indexing root node: 8723161a-3899-447b-a448-3a354455d02c:
This typically occurs after the deletion of the searchindex directory. JackRabbit access all nodes detects the inconsistency. As a result, WebManager will not startup.
JackRabbit is capable to detect and solve problems in the JCR by itself.
This is a startup option that is not active by default because this would cause a download of the entire JCR from the database with every restart.
When problems with the JCR occur, it can be a usefull option to switch on.
To switch it on:
- Stop WebManager
- Add the following options to the PersistenceManager sections of the repository.xml:
To only perform a check:
<param name="consistencyCheck" value="true" />
Or to perform both a JCR check and repair.
<param name="consistencyCheck" value="true" />
<param name="consistencyFix" value="true" />
- When the repisotory.xml has been changed the rest of the content of the (below) folder must be purged after a backup of the JCR in the database has been made.
<<WebManager install dir>>\work\JCR
- Now WebManager can be started, during this startup JackRabbit will perform the consistency check and repair.
Also the SearchIndex will rebuilt. This process can take somewhere from several minutes to several hours depending on the size of the JCR.
The logfile wil contain messages like this:
Jun 10, 2008 2:21:21 PM org.apache.jackrabbit.core.persistence.bundle.BundleDbPersistenceManager checkConsistency
SEVERE: NodeState 773b3d52-9c64-4862-837f-6066de3b5ddd references unexistent child {http:element with id 8723161a-3899-447b-a448-3a354455d02c
When the restart has finished successfully the following steps must be performed to complete the repair this procedure:
- Stop WebManager
- Remove the added parameters from the repository.xml
- Purge the <<WebManager install dir>>\work\JCR folder again (except for the repository.xml)
- Start WebManager
After these actions JackRabbit is consistent again and WebManager should function as normal.
Problems found during the consistency check/repair are logged in the catalina.out.