You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@sling.apache.org by John Logan <Jo...@texture.com> on 2016/09/26 20:42:25 UTC
"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(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
Re: "OakConstraint0033: Unknown required primary type" with custom
types.
Posted by John Logan <Jo...@texture.com>.
Thanks, that makes sense!
I've confirmed that correcting this error addresses the problem.
John
________________________________
From: Stefan Seifert <ss...@pro-vision.de>
Sent: Tuesday, September 27, 2016 2:23:29 PM
To: users@sling.apache.org
Subject: RE: "OakConstraint0033: Unknown required primary type" with custom types.
this seems to be the problem:
> + cover_image (string)
"+" defines a child node, properties are defined by "-".
this tries to create a child node of primary type "string", which does not exist.
stefan
RE: "OakConstraint0033: Unknown required primary type" with custom
types.
Posted by Stefan Seifert <ss...@pro-vision.de>.
this seems to be the problem:
> + cover_image (string)
"+" defines a child node, properties are defined by "-".
this tries to create a child node of primary type "string", which does not exist.
stefan
Re: "OakConstraint0033: Unknown required primary type" with custom
types.
Posted by John Logan <Jo...@texture.com>.
Hi Stefan,
Thanks for taking a look. Here it is.
<nimcb = 'http://ct.nextissuemedia.com/nimcb/1.0'>
[nimcb:Publisher] > nt:unstructured, mix:referenceable
- nim_key_code (string) primary mandatory
- display_name (string) mandatory
[nimcb:Title] > sling:Folder
- nim_key_code (string) primary mandatory
- display_name (string) mandatory
- newsfeedurl (string)
- publisher (reference) mandatory
- horizontal_navigation_only (boolean) = false
- show_play_icon (boolean) = false
- bounce_enabled (boolean) = false
- cb_json (string)
- stacked_letterbox_mode (boolean) = false
- language (string) = 'en' mandatory
[nimcb:Issue] > sling:Folder
- cover_date (date) primary mandatory
- display_cover_date (string) mandatory
- go_live_date (date) mandatory
+ cover_image (string)
- scale_content (string)
- bounce_enabled (boolean) = false
- show_play_icon (boolean) = false
- cb_json (string)
- pub_type (string)
- article_cover_date (date)
________________________________
From: Stefan Seifert <ss...@pro-vision.de>
Sent: Monday, September 26, 2016 2:31:51 PM
To: users@sling.apache.org
Subject: RE: "OakConstraint0033: Unknown required primary type" with custom types.
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.Logan@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
RE: "OakConstraint0033: Unknown required primary type" with custom
types.
Posted by Stefan Seifert <ss...@pro-vision.de>.
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.Logan@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