Hi,
I'm trying to register some new node types by creating a CND file in one of our
bundles, and configuring the Sling-Namespaces and Sling-Nodetypes in the bundle
configuration.
When Sling starts, I see two instances of the following in the log:
2016-09-26 19:24:36,587 *WARN* [FelixStartLevel]
org.apache.sling.jcr.oak.server.internal.OakSlingRepositoryManager
anonymous.read.all is true, granting anonymous user read access on /
2016-09-26 19:24:36,774 *ERROR* [FelixStartLevel]
org.apache.sling.jcr.base.internal.loader.Loader Error loading node types
SLING-INF/nodetypes/nimcb.cnd from bundle nim-services:1.0.0.SNAPSHOT (91): {}
javax.jcr.nodetype.ConstraintViolationException: Failed to register node types.
at
org.apache.jackrabbit.oak.api.CommitFailedException.asRepositoryException(CommitFailedException.java:225)
at
org.apache.jackrabbit.oak.plugins.nodetype.write.ReadWriteNodeTypeManager.registerNodeTypes(ReadWriteNodeTypeManager.java:156)
at
org.apache.jackrabbit.commons.cnd.CndImporter.registerNodeTypes(CndImporter.java:162)
at
org.apache.sling.jcr.base.NodeTypeLoader.registerNodeType(NodeTypeLoader.java:124)
at
org.apache.sling.jcr.base.internal.loader.Loader.registerNodeTypes(Loader.java:285)
at
org.apache.sling.jcr.base.internal.loader.Loader.registerBundleInternal(Loader.java:226)
...
Caused by: org.apache.jackrabbit.oak.api.CommitFailedException:
OakConstraint0033: Unknown required primary type string
at
org.apache.jackrabbit.oak.plugins.nodetype.TypeRegistration.validateAndCompileChildNodeDefinition(TypeRegistration.java:463)
at
org.apache.jackrabbit.oak.plugins.nodetype.TypeRegistration.validateAndCompileType(TypeRegistration.java:344)
at
org.apache.jackrabbit.oak.plugins.nodetype.TypeRegistration.apply(TypeRegistration.java:140)
My CND file defines the following types:
[nimcb:Publisher] > nt:unstructured, mix:referenceable
...
[nimcb:Title] > sling:Folder
...
[nimcb:Issue] > sling:Folder
Just to test, I changed 'sling:Folder' to 'nt:folder' and saw the same result.
It looks like my CND file might be getting loaded prior to the base types being
registered. Could I be missing a step in my configuration?
Thanks! John