You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@jackrabbit.apache.org by Jacco van Weert <11...@gmail.com> on 2007/08/30 11:52:47 UTC

ItemNotFoundException: Orphaned item

Hello,

In one or the other way, I guess with concurrent writing to the repository,
I now have a repository with part of the tree generating a
"ItemNotFoundException: orphaned item" exception.


javax.jcr.ItemNotFoundException: failed to build path of
1c794462-bc1c-4771-a800-20697e9f5c03: orphaned item
 at org.apache.jackrabbit.core.HierarchyManagerImpl.buildPath(
HierarchyManagerImpl.java:292)
 at org.apache.jackrabbit.core.CachingHierarchyManager.buildPath(
CachingHierarchyManager.java:163)
 at org.apache.jackrabbit.core.HierarchyManagerImpl.getPath(
HierarchyManagerImpl.java:356)
 at org.apache.jackrabbit.core.CachingHierarchyManager.getPath(
CachingHierarchyManager.java:224)
 at org.apache.jackrabbit.core.ItemImpl.getPrimaryPath(ItemImpl.java:295)
 at org.apache.jackrabbit.core.ItemImpl.getPath(ItemImpl.java:1381)
 at nl.msd.jcr.gui.JCRE_DefaultTreeNode.setJCRItem
(JCRE_DefaultTreeNode.java:391)

Is there a way te prevent this from happening or to get rid of those
objects?


Greetings,

   Jacco




-- 
-------------------------------------
Jacco van Weert -- 1111software@gmail.com
JCR Controller -- http://www.xs4all.nl/~weertj/jcr

Re: ItemNotFoundException: Orphaned item

Posted by Jacco van Weert <11...@gmail.com>.
On 8/31/07, Stefan Guggisberg <st...@gmail.com> wrote:
>
> On 8/30/07, Jacco van Weert <11...@gmail.com> wrote:
> > On 8/30/07, Stefan Guggisberg <st...@gmail.com> wrote:
> > >
> >
> > Yes, some actions are done by the admin session.... I guess I should
> > synchronize on the admin session?
>
> yes. javax.jcr.Session is, per spec,  not thread-safe. while sharing a
> read-only session among multiple threads could probably work (yet
> untested),
> sharing a r/w session might lead to corrupt data.



Ok, that's clear and I can understand why.
Anyway it should be nice to have some sort of repair option, because
programming error's can occur :-) and
corrupt databases are very hard to explain.


>
> cheers
> stefan



Thanks for the help.


  Jacco

Re: ItemNotFoundException: Orphaned item

Posted by Stefan Guggisberg <st...@gmail.com>.
On 8/30/07, Jacco van Weert <11...@gmail.com> wrote:
> On 8/30/07, Stefan Guggisberg <st...@gmail.com> wrote:
> >
> > On 8/30/07, Jacco van Weert <11...@gmail.com> wrote:
> > > Hi Stefan
> > >
> > >
> > > I use Jackrabbit 1.3.1 with Java 1.6.0_02 (Linux).
> > > I have a servlet application which uses the TransientRepository. There
> > is
> > > one "admin" session which is used for e.g. expiring objects and every
> > > incoming call has it's own Session.
> >
> > is the 'admin' session possibly shared among multiple threads?
>
>
>
> Yes, some actions are done by the admin session.... I guess I should
> synchronize on the admin session?

yes. javax.jcr.Session is, per spec,  not thread-safe. while sharing a
read-only session among multiple threads could probably work (yet untested),
sharing a r/w session might lead to corrupt data.

>
>
>
> >
> >
> > >
> > > I have no extensions (except for the extractor). I do have my own
> > > AccesManager.
> >
> > does your AccesManager access the repository (i.e. read nodes/properties)?
>
>
> Yes but those methods (which pass the accessmanager again) follow a
> different code path.

see my previous comment.same concern here.

cheers
stefan

>
>
> what persistence manager are you using?
>
>
> The standard derby db, no change on the default
>
>
> does more than one node cause the above mentioned exception?
>
>
> It's only one node but it prevents any action in that part of the tree.
>
>
> are you able to read the said node(s) by calling Session#getNodeByUuid()?
> >
> > the exception actually refers to a node that has a 'null' parentId.
> > what jcr call
> > does cause the exception, i mean how do you access the affected node
> > in the first place?
>
>
> I will get back to you on those questions tomorrow.
>
>
>
>
> Jacco
>
>
>
> --
> -------------------------------------
> Jacco van Weert -- 1111software@gmail.com
> JCR Controller -- http://www.xs4all.nl/~weertj/jcr
>

Re: ItemNotFoundException: Orphaned item

Posted by Jacco van Weert <11...@gmail.com>.
On 8/30/07, Stefan Guggisberg <st...@gmail.com> wrote:
>
> On 8/30/07, Jacco van Weert <11...@gmail.com> wrote:
> > Hi Stefan
> >
> >
> > I use Jackrabbit 1.3.1 with Java 1.6.0_02 (Linux).
> > I have a servlet application which uses the TransientRepository. There
> is
> > one "admin" session which is used for e.g. expiring objects and every
> > incoming call has it's own Session.
>
> is the 'admin' session possibly shared among multiple threads?



Yes, some actions are done by the admin session.... I guess I should
synchronize on the admin session?



>
>
> >
> > I have no extensions (except for the extractor). I do have my own
> > AccesManager.
>
> does your AccesManager access the repository (i.e. read nodes/properties)?


Yes but those methods (which pass the accessmanager again) follow a
different code path.


what persistence manager are you using?


The standard derby db, no change on the default


does more than one node cause the above mentioned exception?


It's only one node but it prevents any action in that part of the tree.


are you able to read the said node(s) by calling Session#getNodeByUuid()?
>
> the exception actually refers to a node that has a 'null' parentId.
> what jcr call
> does cause the exception, i mean how do you access the affected node
> in the first place?


I will get back to you on those questions tomorrow.




Jacco



-- 
-------------------------------------
Jacco van Weert -- 1111software@gmail.com
JCR Controller -- http://www.xs4all.nl/~weertj/jcr

Re: ItemNotFoundException: Orphaned item

Posted by Stefan Guggisberg <st...@gmail.com>.
On 8/30/07, Jacco van Weert <11...@gmail.com> wrote:
> Hi Stefan
>
>
>
>
> > well, this should never happen ;-)
>
>  please provide more information about your
> > setup, configuration, deployment, any custom extensions, usage pattern of
> > javax.jcr.Session, etc.
>
>
> Well, I think nothing really special;
>
> I use Jackrabbit 1.3.1 with Java 1.6.0_02 (Linux).
> I have a servlet application which uses the TransientRepository. There is
> one "admin" session which is used for e.g. expiring objects and every
> incoming call has it's own Session.

is the 'admin' session possibly shared among multiple threads?

>
> I have a concurrent thread problem in which sometimes the "admin" session
> wants to remove a node which has been changed but not saved giving me the
> "the item cannot be saved because it has been modified externally." error.
> I am already working on a solution for my thread problem, I suspect that one
> of these errors resulted in the "orphaned item" error.

as long as the concurrent threads use separate sessions each this
shouldn't be a problem.

>
> I have no extensions (except for the extractor). I do have my own
> AccesManager.

does your AccesManager access the repository (i.e. read nodes/properties)?

what persistence manager are you using?

does more than one node cause the above mentioned exception?
are you able to read the said node(s) by calling Session#getNodeByUuid()?

the exception actually refers to a node that has a 'null' parentId.
what jcr call
does cause the exception, i mean how do you access the affected node
in the first place?

>
>
> Jacco
>
>
> --
> -------------------------------------
> Jacco van Weert -- 1111software@gmail.com
> JCR Controller -- http://www.xs4all.nl/~weertj/jcr
>

Re: ItemNotFoundException: Orphaned item

Posted by Jacco van Weert <11...@gmail.com>.
Hi Stefan




> well, this should never happen ;-)

 please provide more information about your
> setup, configuration, deployment, any custom extensions, usage pattern of
> javax.jcr.Session, etc.


Well, I think nothing really special;

I use Jackrabbit 1.3.1 with Java 1.6.0_02 (Linux).
I have a servlet application which uses the TransientRepository. There is
one "admin" session which is used for e.g. expiring objects and every
incoming call has it's own Session.

I have a concurrent thread problem in which sometimes the "admin" session
wants to remove a node which has been changed but not saved giving me the
"the item cannot be saved because it has been modified externally." error.
I am already working on a solution for my thread problem, I suspect that one
of these errors resulted in the "orphaned item" error.

I have no extensions (except for the extractor). I do have my own
AccesManager.


Jacco


-- 
-------------------------------------
Jacco van Weert -- 1111software@gmail.com
JCR Controller -- http://www.xs4all.nl/~weertj/jcr

Re: ItemNotFoundException: Orphaned item

Posted by Stefan Guggisberg <st...@gmail.com>.
hi jacco

On 8/30/07, Jacco van Weert <11...@gmail.com> wrote:
> Hello,
>
> In one or the other way, I guess with concurrent writing to the repository,
> I now have a repository with part of the tree generating a
> "ItemNotFoundException: orphaned item" exception.
>
>
> javax.jcr.ItemNotFoundException: failed to build path of
> 1c794462-bc1c-4771-a800-20697e9f5c03: orphaned item
>  at org.apache.jackrabbit.core.HierarchyManagerImpl.buildPath(
> HierarchyManagerImpl.java:292)
>  at org.apache.jackrabbit.core.CachingHierarchyManager.buildPath(
> CachingHierarchyManager.java:163)
>  at org.apache.jackrabbit.core.HierarchyManagerImpl.getPath(
> HierarchyManagerImpl.java:356)
>  at org.apache.jackrabbit.core.CachingHierarchyManager.getPath(
> CachingHierarchyManager.java:224)
>  at org.apache.jackrabbit.core.ItemImpl.getPrimaryPath(ItemImpl.java:295)
>  at org.apache.jackrabbit.core.ItemImpl.getPath(ItemImpl.java:1381)
>  at nl.msd.jcr.gui.JCRE_DefaultTreeNode.setJCRItem
> (JCRE_DefaultTreeNode.java:391)
>
> Is there a way te prevent this from happening or to get rid of those
> objects?

well, this should never happen ;-) please provide more information about your
setup, configuration, deployment, any custom extensions, usage pattern of
javax.jcr.Session, etc.

cheers
stefan

>
>
> Greetings,
>
>    Jacco
>
>
>
>
> --
> -------------------------------------
> Jacco van Weert -- 1111software@gmail.com
> JCR Controller -- http://www.xs4all.nl/~weertj/jcr
>