Custom node types file issues

Jackrabbit aggregates all declared node types into a single file called custom_nodetype.xml. As explained in File system, the custom_nodetypes.xml file can exist on the filesystem or in a database.

The custom_nodetypes file can always be regenerated by:

  1. Shutting down your Magnolia instance

  2. Deleting or renaming the existing file

  3. Starting it up again

Troubleshooting

NoSuchNodeTypeException: This exception means the node type was not aggregated into the file. Check to see if it’s declared correctly. Did you use CND format or XML format? Check the startup log to be sure the custom_nodetype.xml file was read without errors.

Examples of custom node type registrations in the logs
2024-05-07 07:23:56,779 INFO  info.magnolia.jackrabbit.ProviderImpl : Custom node types registered using /mgnl-nodetypes/magnolia-dam-nodetypes.cnd
2024-05-07 07:23:57,200 INFO  info.magnolia.jackrabbit.ProviderImpl : Custom node types registered using /mgnl-nodetypes/tasks-nodetypes.xml

You can always try to reregister the node types manually by running the Groovy script below.

Groovy workaround
import info.magnolia.objectfactory.Components;
import info.magnolia.repository.RepositoryManager;

nodeTypeFilePath = "/mgnl-nodetypes/my-custom-nodetypes.cnd";

repositoryManager = Components.getComponent(RepositoryManager.class);
repositoryProvider = repositoryManager.getRepositoryProvider("magnolia");
repositoryProvider.registerNodeTypes(nodeTypeFilePath);

println "Custom node types registered using " + nodeTypeFilePath
Feedback

DX Core

×

Location

This widget lets you know where you are on the docs site.

You are currently perusing through the DX Core docs.

Main doc sections

DX Core Headless PaaS Legacy Cloud Incubator modules