RE: "OakConstraint0033: Unknown required primary type" with custom types.

2016-09-26 Thread Stefan Seifert
can you attach the full CND file content?
there seems to be the keyword "string" interpreted as node type due to a syntax 
error.

a string property should be defined like this:

  - dialogPath (string)

see http://jackrabbit.apache.org/jcr/node-type-notation.html for details.

stefan

>-Original Message-
>From: John Logan [mailto:john.lo...@texture.com]
>Sent: Monday, September 26, 2016 10:42 PM
>To: users@sling.apache.org
>Subject: "OakConstraint0033: Unknown required primary type" with custom
>types.
>
>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(C
>ommitFailedException.java:225)
>at
>org.apache.jackrabbit.oak.plugins.nodetype.write.ReadWriteNodeTypeManager.r
>egisterNodeTypes(ReadWriteNodeTypeManager.java:156)
>at
>org.apache.jackrabbit.commons.cnd.CndImporter.registerNodeTypes(CndImporter
>.java:162)
>at
>org.apache.sling.jcr.base.NodeTypeLoader.registerNodeType(NodeTypeLoader.ja
>va:124)
>at
>org.apache.sling.jcr.base.internal.loader.Loader.registerNodeTypes(Loader.j
>ava:285)
>at
>org.apache.sling.jcr.base.internal.loader.Loader.registerBundleInternal(Loa
>der.java:226)
>...
>
>Caused by: org.apache.jackrabbit.oak.api.CommitFailedException:
>OakConstraint0033: Unknown required primary type string
>at
>org.apache.jackrabbit.oak.plugins.nodetype.TypeRegistration.validateAndComp
>ileChildNodeDefinition(TypeRegistration.java:463)
>at
>org.apache.jackrabbit.oak.plugins.nodetype.TypeRegistration.validateAndComp
>ileType(TypeRegistration.java:344)
>at
>org.apache.jackrabbit.oak.plugins.nodetype.TypeRegistration.apply(TypeRegis
>tration.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



"OakConstraint0033: Unknown required primary type" with custom types.

2016-09-26 Thread John Logan
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