Repository error when starting DXM

  Written by The Jahia Team
   Estimated reading time:
7.1.1.0

Repository error when starting DXM
 

javax.jcr.RepositoryException: internal error: failed to read custom node type definitions Stored in /nodetypes/custom_nodetypes.xml
unknown nodetypes and mixins

Cause

possible corruption while upgrading from 6.6.x.x

Solution

From https://jira.jahia.org/browse/JKB-29

When you startup Jahia after modules or templates deployment, you may get the following error message :

Error: internal error: failed to read custom node type definitions stored in /nodetypes/custom_nodetypes.xml

This error is preventing JackRabbit and Jahia to startup. This may occur if for some reason one of the CND of your modules or templates is either corrupted or incorrectly encoded. This in turns corrupts the internal definitions registry of jackrabbit ( custom_nodetypes.xml ), which is read by Jackrabbit during startup, and because it is corrupted ( Premature end of file error can be seen in the logs ) Jackrabbit is not able to start.. This information is stored in a JackRabbit table in the database, so a file with that name doesn't show up on the file system.

As the custom_nodetypes.xml database entry is corrupted, you will need to delete it so that it is rebuilt during the next startup. Here is the procedure to delete this entry :

  • Stop all your Jahia servers.
  • Backup the database.
  • Run this request so that you can retrieve the faulty entry from the database : select * from jr_fsg_fsentry where fsentry_path='/nodetypes' and fsentry_name='custom_nodetypes.xml';
  • Drop the entry from the database : 
    delete from jr_fsg_fsentry where fsentry_path='/nodetypes' and fsentry_name='custom_nodetypes.xml';
  • Restart first the processing/indexing node
  • Then when the processing node has started start the other nodes

IMPORTANT : If you are using Digital Factory 7, please note that 2 additional steps are required :

  • Flush the content of the table "jahia_nodetypes_provider" : This will re-scan all the CNDs
  • Delete content of the directory "digital-factory-data/bundles-deployed/" : This is the OSGI cache directory.

Also, truncate the table "jahia_nodetypes_provider" before restarting