Return-Path: Delivered-To: apmail-jackrabbit-users-archive@minotaur.apache.org Received: (qmail 45405 invoked from network); 10 Nov 2009 10:53:43 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (140.211.11.3) by minotaur.apache.org with SMTP; 10 Nov 2009 10:53:43 -0000 Received: (qmail 82211 invoked by uid 500); 10 Nov 2009 10:53:42 -0000 Delivered-To: apmail-jackrabbit-users-archive@jackrabbit.apache.org Received: (qmail 82153 invoked by uid 500); 10 Nov 2009 10:53:42 -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 82142 invoked by uid 99); 10 Nov 2009 10:53:42 -0000 Received: from nike.apache.org (HELO nike.apache.org) (192.87.106.230) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 10 Nov 2009 10:53:42 +0000 X-ASF-Spam-Status: No, hits=-0.0 required=10.0 tests=SPF_PASS X-Spam-Check-By: apache.org Received-SPF: pass (nike.apache.org: domain of aklimets@day.com designates 207.126.148.87 as permitted sender) Received: from [207.126.148.87] (HELO eu3sys201aog101.obsmtp.com) (207.126.148.87) by apache.org (qpsmtpd/0.29) with SMTP; Tue, 10 Nov 2009 10:53:33 +0000 Received: from source ([209.85.216.172]) by eu3sys201aob101.postini.com ([207.126.154.11]) with SMTP ID DSNKSvlGGNndE4nDrygDVuVSCJBMRSs3IhJD@postini.com; Tue, 10 Nov 2009 10:53:13 UTC Received: by pxi2 with SMTP id 2so476000pxi.11 for ; Tue, 10 Nov 2009 02:53:11 -0800 (PST) MIME-Version: 1.0 Received: by 10.140.169.10 with SMTP id r10mr554437rve.16.1257850391626; Tue, 10 Nov 2009 02:53:11 -0800 (PST) In-Reply-To: <1257849485766-585325.post@n4.nabble.com> References: <1257846588391-585307.post@n4.nabble.com> <1257849485766-585325.post@n4.nabble.com> Date: Tue, 10 Nov 2009 11:53:11 +0100 Message-ID: Subject: Re: Weird behaviour with child type resolution From: Alexander Klimetschek To: users@jackrabbit.apache.org Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable X-Virus-Checked: Checked by ClamAV on apache.org On Tue, Nov 10, 2009 at 11:38, panos.athanasiou wrote: > name=3D"myNameSpace:AnotherEntity" primaryItemName=3D""> > =A0 =A0 =A0 =A0 =A0 =A0 =A0 > =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0myNameSpace:Bas= eEntity > =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 > =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0defaultPrimaryType=3D"" ma= ndatory=3D"false" > > name=3D"myNameSpace:BaseEntity" This means that this child node definition only allows child nodes named "myNameSpace:BaseEntity"... > =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0onParentVersion=3D"IGNORE"= protected=3D"false" sameNameSiblings=3D"true"> > =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 > =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0myNam= eSpace:BaseEntity > =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 > =A0 =A0 =A0 =A0 > > > > The actual code for creation looks like this: > > Node aNode =3D nodeOfTypeAnotherEntity.addNode("myNameSpace:YetAnotherEnt= ity", > "myNameSpace:YetAnotherEntity"); .. but here you are using "myNameSpace:YetAnotherEntity" (first param) as node name. Thus it fails. You should change the name of the child node definition (you can use "*" to allow any node name) or the name used in the addNode() call. See also http://jackrabbit.apache.org/node-type-notation.html#NodeTypeNotat= ion-NodeName BTW, I would recommend not to use the same names for node types and node names, and only use namespaces in node names/property names if they should really be distinctive. Otherwise using plain names is much more readable and forces more standardization of names in and between your applications. Regards, Alex --=20 Alexander Klimetschek alexander.klimetschek@day.com