From users-return-13250-apmail-jackrabbit-users-archive=jackrabbit.apache.org@jackrabbit.apache.org Tue Nov 10 10:38:40 2009 Return-Path: Delivered-To: apmail-jackrabbit-users-archive@minotaur.apache.org Received: (qmail 41890 invoked from network); 10 Nov 2009 10:38:40 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (140.211.11.3) by minotaur.apache.org with SMTP; 10 Nov 2009 10:38:40 -0000 Received: (qmail 63282 invoked by uid 500); 10 Nov 2009 10:38:40 -0000 Delivered-To: apmail-jackrabbit-users-archive@jackrabbit.apache.org Received: (qmail 63218 invoked by uid 500); 10 Nov 2009 10:38:39 -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 63206 invoked by uid 99); 10 Nov 2009 10:38:39 -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:38:39 +0000 X-ASF-Spam-Status: No, hits=1.1 required=10.0 tests=FB_GET_MEDS,SPF_HELO_PASS,SPF_PASS X-Spam-Check-By: apache.org Received-SPF: pass (nike.apache.org: domain of lists+1257438615597-510167@n4.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; Tue, 10 Nov 2009 10:38:26 +0000 Received: from joe.nabble.com ([192.168.236.151]) by kuber.nabble.com with esmtp (Exim 4.63) (envelope-from ) id 1N7o6v-0005ld-Oz for users@jackrabbit.apache.org; Tue, 10 Nov 2009 02:38:05 -0800 Date: Tue, 10 Nov 2009 02:38:05 -0800 (PST) From: "panos.athanasiou" To: users@jackrabbit.apache.org Message-ID: <1257849485766-585325.post@n4.nabble.com> In-Reply-To: References: <1257846588391-585307.post@n4.nabble.com> Subject: Re: Weird behaviour with child type resolution MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable X-Nabble-From: "panos.athanasiou" X-Virus-Checked: Checked by ClamAV on apache.org The XML describing the mentioned types is as following: =09=09 =09=09=09mix:referenceable =09=09=09nt:base =09=09 =09=09 =09=09 =09=09=09myNameSpace:BaseEntity =09=09 =09=09=09myNameSpace:BaseEntity =09=09 =09 =09 =09=09 =09=09=09myNameSpace:BaseEntity =09=09 =09 I am using version 1.5.5 .=20 The actual code for creation looks like this: Node aNode =3D nodeOfTypeAnotherEntity.addNode("myNameSpace:YetAnotherEntit= y", "myNameSpace:YetAnotherEntity"); As it has come to my understanding, EffectiveNodeType.getNamedItemDefs() returns only Item definitions for types directly mentioned in the definition. Thus, given that EffectiveNodeType.getApplicableChildNodeDef() works on the given type (in my case, this is "myNameSpace:YetAnotherEntity"= ) but not it's supertypes, it seems normal that the type resolution does not happen as i expected. At least, that much i gathered while trying out different things with the debugger. Alexander Klimetschek wrote: >=20 > On Tue, Nov 10, 2009 at 10:49, panos.athanasiou > wrote: >> Thus, i created the following entities: >> >> myNameSpace:BaseEntity >> >> myNameSpace:AnotherEntity with children of type BaseEntity >> >> myNameSpace:YetAnotherEntity having as supertype BaseEntity. >> >> >> Then, i created an instance of myNameSpace:AnotherEntity and tried to ad= d >> to >> it a Node of type myNameSpace:YetAnotherEntity. To my surprise though, i >> received an exception like the following: >> >> javax.jcr.nodetype.ConstraintViolationException: no definition found in >> parent node's node type for new node: no matching child node definition >> found for {http://myNameSpace.org/}YetAnotherEntity : no matching child >> node >> definition found for {http://myNameSpace.org/}YetAnotherEntity >> =C2=A0 =C2=A0 =C2=A0 =C2=A0at >> org.apache.jackrabbit.core.NodeImpl.internalAddChildNode(NodeImpl.java:7= 68) >> =C2=A0 =C2=A0 =C2=A0 =C2=A0at >> org.apache.jackrabbit.core.NodeImpl.internalAddNode(NodeImpl.java:734) >> =C2=A0 =C2=A0 =C2=A0 =C2=A0at >> org.apache.jackrabbit.core.NodeImpl.internalAddNode(NodeImpl.java:682) >> =C2=A0 =C2=A0 =C2=A0 =C2=A0at org.apache.jackrabbit.core.NodeImpl.addNod= e(NodeImpl.java:2115) >> >> Any ideas/suggestions? >=20 > It should work. Could you post your node type definitions (cnd, xml, > whatever you used)? >=20 > Regards, > Alex >=20 > --=20 > Alexander Klimetschek > alexander.klimetschek@day.com >=20 >=20 --=20 View this message in context: http://n4.nabble.com/Weird-behaviour-with-chi= ld-type-resolution-tp585307p585325.html Sent from the Jackrabbit - Users mailing list archive at Nabble.com.