Return-Path: Delivered-To: apmail-jackrabbit-users-archive@locus.apache.org Received: (qmail 11244 invoked from network); 3 Sep 2007 15:30:10 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (140.211.11.2) by minotaur.apache.org with SMTP; 3 Sep 2007 15:30:10 -0000 Received: (qmail 64524 invoked by uid 500); 3 Sep 2007 15:30:04 -0000 Delivered-To: apmail-jackrabbit-users-archive@jackrabbit.apache.org Received: (qmail 64499 invoked by uid 500); 3 Sep 2007 15:30:04 -0000 Mailing-List: contact users-help@jackrabbit.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: users@jackrabbit.apache.org Delivered-To: mailing list users@jackrabbit.apache.org Received: (qmail 64490 invoked by uid 99); 3 Sep 2007 15:30:04 -0000 Received: from athena.apache.org (HELO athena.apache.org) (140.211.11.136) by apache.org (qpsmtpd/0.29) with ESMTP; Mon, 03 Sep 2007 08:30:04 -0700 X-ASF-Spam-Status: No, hits=2.6 required=10.0 tests=DNS_FROM_OPENWHOIS,SPF_HELO_PASS,SPF_PASS,WHOIS_MYPRIVREG X-Spam-Check-By: apache.org Received-SPF: pass (athena.apache.org: domain of lists@nabble.com designates 216.139.236.158 as permitted sender) Received: from [216.139.236.158] (HELO kuber.nabble.com) (216.139.236.158) by apache.org (qpsmtpd/0.29) with ESMTP; Mon, 03 Sep 2007 15:29:59 +0000 Received: from isper.nabble.com ([192.168.236.156]) by kuber.nabble.com with esmtp (Exim 4.63) (envelope-from ) id 1ISDrv-0001c7-Bk for users@jackrabbit.apache.org; Mon, 03 Sep 2007 08:29:39 -0700 Message-ID: <12463572.post@talk.nabble.com> Date: Mon, 3 Sep 2007 08:29:39 -0700 (PDT) From: Kaizer To: users@jackrabbit.apache.org Subject: Re: Problem adding a child node In-Reply-To: <5690775.post@talk.nabble.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit X-Nabble-From: Kaizers@mastek.com References: <5690775.post@talk.nabble.com> X-Virus-Checked: Checked by ClamAV on apache.org I am getting a similar exception on adding nodes. Node hello = root.addNode("hello","nt:base"); Node world = hello.addNode("world","nt:base"); javax.jcr.nodetype.ConstraintViolationException: no definition found in parent node's node type for new node: no matching child node definition found for {}world: no matching child node definition found for {}world What should i do in this case? Thanks. JavaJ wrote: > > 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#a12463572 Sent from the Jackrabbit - Users mailing list archive at Nabble.com.