Thank you Aparna!
I think this was the problem:
On my first execution my second node was not "world", but "wolrd".
And after experimenting with "root.getNode("hello").remove();" I
removed it unconsciously.
And that's why it worked!
So in this case in order for my problem to be reproduced, the final
source code was not enough, but all changes from the beginning to the
end of using Jackrabbit (I made at least 3 changes during my
experimentation).
Thank you both!
Nikolay
On Mon, Aug 29, 2011 at 3:04 PM, Aparna Chaudhary
<[email protected]> wrote:
> Looks like some mess up with same name siblings. You might want to clean up
> the content and run the test.
>
> // Remove content
> // iterative removal of same name sibling child nodes
> NodeIterator ni = root.getNodes();
> while (ni.hasNext()) {
> Node n = ni.nextNode();
> if(n.getName().equalsIgnoreCase("hello")){
> System.out.println("removing " + n.getPath());
> n.remove();
> }
> }
> session.save();
>
> Regards,
> Aparna
>
> On Mon, Aug 29, 2011 at 2:56 PM, Stefan Guggisberg <
> [email protected]> wrote:
>
>> On Mon, Aug 29, 2011 at 2:24 PM, Nikolay Georgiev
>> <[email protected]> wrote:
>> > Hello,
>> >
>> > I am trying the run the SecondHop.java from
>> > http://jackrabbit.apache.org/first-hops.html
>> >
>> > but I get the exception:
>> > javax.jcr.PathNotFoundException: hello/world
>> > at
>> org.apache.jackrabbit.core.NodeImpl$8.perform(NodeImpl.java:2120)
>> > at
>> org.apache.jackrabbit.core.NodeImpl$8.perform(NodeImpl.java:2114)
>> > at
>> org.apache.jackrabbit.core.session.SessionState.perform(SessionState.java:188)
>> > at org.apache.jackrabbit.core.ItemImpl.perform(ItemImpl.java:91)
>> > at org.apache.jackrabbit.core.NodeImpl.getNode(NodeImpl.java:2114)
>> > at com.db.intranet.poc.pocdlcwithjr.App.main(App.java:33)
>> >
>> > Do you know what could be the problem and how could I fix it?
>>
>> there's no way of telling what's wrong without knowing what you're doing.
>> ;)
>> could you please provide your source code (App.java)?
>>
>> cheers
>> stefan
>>
>> >
>> > Thank you!
>> >
>> > Nikolay
>> >
>>
>