jackrabbit-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From JavaJ <ponfa...@yahoo.com>
Subject Problem adding a child node
Date Mon, 07 Aug 2006 18:50:38 GMT

Given the following node types:

[cm:myAppContainer] > nt:base,mix:referenceable,mix:versionable
+ cm:myApp (cm:myApp) = cm:myApp multiple version

[cm:myApp] > nt:base,mix:referenceable,mix:versionable
- cm:size (long) mandatory
- cm:rules mandatory
- cm:locale mandatory
- cm:address mandatory

I'm getting an error when I try to add a "myApp" child node to
"myAppContainer".

For example:

// get the "myAppContainer" node
Node container = rootNode.get("/nodes/myAppContainer");

// get the child node definitions to make sure it contains "myApp" child
node definition
NodeDefinition[] defs =
container.getPrimaryNodeType().getDeclaredChildNodeDefinitions();

// add a new "myApp" node
newNode = container.addNode("myNewAppNode", "cm:myApp");

I get this error on this call:

javax.jcr.nodetype.ConstraintViolationException: no definition found in
parent node's node type for new node: 
no matching child node definition found for {}myNewAppNode: 

Is there something I'm doing wrong???

-- 
View this message in context: http://www.nabble.com/Problem-adding-a-child-node-tf2065497.html#a5690775
Sent from the Jackrabbit - Users forum at Nabble.com.


Mime
View raw message