Hi Stefan & David, You are both right that the exception was correct. Somehow part of an older version of the code was brought back to my workspace from the CVS. A conflict of node type definitions caused this problem. Sorry about the false alarm. Regards, Dan
> -----Original Message----- > From: Stefan Guggisberg [mailto:[EMAIL PROTECTED] > Sent: September 6, 2006 4:30 AM > To: [email protected] > Subject: Re: Node.addNode(relPath, nodeType) and > javax.jcr.nodetype.ConstraintViolationException > > hi dan > > On 9/5/06, dan <[EMAIL PROTECTED]> wrote: > > Hi all, > > > > Hope this will be a quick question: > > > > I have the following CND file: > > [myCM:document] > > +* (myCM:field) copy > > [myCM::docReferenceField] > myCM:field > > +* (myCM:documentReference) = myCM:documentReference > > multiple copy > > [myCM:documentReference] >..... > > ... > > > > When I call the addNode method of Node D (myCM:document) as below: > > D.addNode("new document", "myCM:docReferenceField"); > > > > JackRabbit throws javax.jcr.nodetype.ConstraintViolationException. This > is > > not correct, is it? > > i am pretty confident that the exception is correct and that there's > something > wrong with your node type defintions or your application code, > but i might be wrong... ;) > > if you're positive that it is none of the above, please post a jira issue > and > include your node type definitions and a simple test case. > > cheers > stefan > > > > > (According to the specification on child node definition: > > "... but rather that its primary node type (whatever else it may be) > must be > > at least a subtype of both node types X and Y. Of course, inheritance is > > also respected in the simpler case where this attribute specifies only > one > > primary node type. If it specifies, for example, type T, this means that > the > > child node must be of type T or a subtype of type T...") > > > > Thanks, > > Dan > > > >
