[
https://issues.apache.org/jira/browse/SLING-4074?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=14176646#comment-14176646
]
Carsten Ziegeler commented on SLING-4074:
-----------------------------------------
[~jsedding] Right, the optimization was for findResources so that one is now
"suffering" from this.
The fix solves the problem to the point as you note that the exception is
swallowed within the iterator - which is much better than throwing it up the
call stack as such an exception is not expected at all.
JcrNodeResource#getResourceType fails as well, but there the exception is
swalled as well
> Iterating over JCR resources might throw IllegalStateException
> --------------------------------------------------------------
>
> Key: SLING-4074
> URL: https://issues.apache.org/jira/browse/SLING-4074
> Project: Sling
> Issue Type: Bug
> Components: JCR
> Affects Versions: JCR Resource 2.3.8, JCR Resource 2.3.10
> Reporter: Carsten Ziegeler
> Assignee: Carsten Ziegeler
> Priority: Blocker
> Fix For: JCR Resource 2.3.12
>
>
> With the recent changes to speed up iterating over jcr resources, the
> iterator might now throw an IllegalStateException if the resource is gone in
> the meantime:
> java.lang.IllegalStateException: Failed to retrieve path from Item:
> at
> org.apache.sling.jcr.resource.internal.helper.jcr.JcrItemResource.getPath(JcrItemResource.java:82)
> at
> org.apache.sling.resourceresolver.impl.helper.ResourceIterator.seek(ResourceIterator.java:184)
> at
> org.apache.sling.resourceresolver.impl.helper.ResourceIterator.<init>(ResourceIterator.java:151)
> at
> org.apache.sling.resourceresolver.impl.ResourceResolverImpl.listChildren(ResourceResolverImpl.java:634)
> at
> org.apache.sling.api.resource.AbstractResource.listChildren(AbstractResource.java:97)
> at
> org.apache.sling.event.impl.jobs.JobTopicTraverser.traverse(JobTopicTraverser.java:145)
> at
> org.apache.sling.event.impl.jobs.JobTopicTraverser.traverse(JobTopicTraverser.java:86)
> at
> org.apache.sling.event.impl.jobs.topics.QueueJobCache.loadJobs(QueueJobCache.java:195)
> at
> org.apache.sling.event.impl.jobs.topics.QueueJobCache.loadJobs(QueueJobCache.java:149)
> at
> org.apache.sling.event.impl.jobs.topics.QueueJobCache.getNextJob(QueueJobCache.java:117)
> at
> org.apache.sling.event.impl.jobs.topics.TopicManager.take(TopicManager.java:227)
> at
> org.apache.sling.event.impl.jobs.queues.AbstractJobQueue.take(AbstractJobQueue.java:317)
> at
> org.apache.sling.event.impl.jobs.queues.AbstractJobQueue.runJobQueue(AbstractJobQueue.java:305)
> at
> org.apache.sling.event.impl.jobs.queues.AbstractJobQueue.access$000(AbstractJobQueue.java:59)
> at
> org.apache.sling.event.impl.jobs.queues.AbstractJobQueue$1.run(AbstractJobQueue.java:166)
> at java.lang.Thread.run(Thread.java:745)
> Caused by: javax.jcr.InvalidItemStateException: Item does not exist anymore:
> 5b16e3ce-ea3f-444f-9161-77cec2831976
> at
> org.apache.jackrabbit.core.ItemImpl.itemSanityCheck(ItemImpl.java:116)
> at org.apache.jackrabbit.core.ItemImpl.perform(ItemImpl.java:90)
> at org.apache.jackrabbit.core.ItemImpl.getPath(ItemImpl.java:376)
> at
> org.apache.sling.jcr.resource.internal.helper.jcr.JcrItemResource.getPath(JcrItemResource.java:80)
> ... 15 common frames omitted
--
This message was sent by Atlassian JIRA
(v6.3.4#6332)