Even more interesting:

12:28:00.502 INFO  [Thread-33] <c.i.l.r.e.ResourceAddedHandler> OSGi resource 
added event received: 
/var/eventing/jobs/assigned/db2af778-5713-4723-ad27-12cd89d2ddb0/com.idexx.labstation.repository.fileuploaded.job/2015/11/24/12/28/com.idexx.labstation.repository.fileuploaded.job_db2af778-5713-4723-ad27-12cd89d2ddb0_2345
12:28:00.518 ERROR [Apache Sling JCR Resource Event Queue Processor] 
<o.apache.jackrabbit.core.ItemManager> f3092eb9-f31e-4299-a976-01caf508018d: 
failed to determine path to
12:28:00.520 ERROR [Apache Sling JCR Resource Event Queue Processor] 
<o.a.s.j.r.i.h.jcr.JcrNodeResource> Unable to get resource type for node node 
f3092eb9-f31e-4299-a976-01caf508018d
javax.jcr.InvalidItemStateException: Item does not exist anymore: 
f3092eb9-f31e-4299-a976-01caf508018d
        at 
org.apache.jackrabbit.core.ItemImpl.itemSanityCheck(ItemImpl.java:116)
        at org.apache.jackrabbit.core.ItemImpl.sanityCheck(ItemImpl.java:104)
        at 
org.apache.jackrabbit.core.NodeImpl.getPrimaryNodeType(NodeImpl.java:2337)
        at 
org.apache.sling.jcr.resource.internal.helper.jcr.JcrItemResource.getResourceTypeForNode(JcrItemResource.java:121)
        at 
org.apache.sling.jcr.resource.internal.helper.jcr.JcrNodeResource.getResourceType(JcrNodeResource.java:95)
        at 
org.apache.sling.jcr.resource.internal.JcrResourceListener.processOsgiEventQueue(JcrResourceListener.java:351)

I looked at the code in JcrResourceListener and it is simply trying to get the 
resource type for the node that triggered the TOPIC_RESOURCE_ADDED handler. 
But, the thing that triggered the event handler is a *job*, and presumably it 
may have been processed and removed in the short time before the event handler 
runs. Is this possibly a bug in Sling?


-----Original Message-----
From: Carsten Ziegeler [mailto:[email protected]] 
Sent: Friday, November 20, 2015 11:39 AM
To: [email protected]
Subject: Re: ResourceResolver and thread safety

Am 20.11.15 um 09:10 schrieb Roll, Kevin:
> OK, allow me to broaden the question. We are getting mysterious repository 
> corruption as previously detailed. I'm fairly certain that this is related to 
> a task I have that scans Resources and sets some node properties but I can't 
> pin down what I might be doing wrong. Are there any common mistakes that 
> might cause the "Item does not exist anymore" exception? I can describe my 
> code in more depth if that would help, but it is rather involved.

This can have several reasons. Usually when I'm seeing this it happens
that concurrent resource resolvers are involved. While for example one
resolver traverses a tree, another one is modifying it.

Carsten

Reply via email to