[
https://issues.apache.org/jira/browse/SLING-4116?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=14189945#comment-14189945
]
Dominik Süß commented on SLING-4116:
------------------------------------
[~rombert] thanks for the pointer and the proposal, [~cziegeler] was a bit too
fast for me ;)
[~cziegeler] I had the patched version running for this morning and did not
experience any issues during development (and did not experience the mentioned
info-spam anymore). Thanks!
> Content length check in JCRNodeResourceMetadata triggers
> javax.jcr.ItemNotFoundException: No primary item present on node
> -------------------------------------------------------------------------------------------------------------------------
>
> Key: SLING-4116
> URL: https://issues.apache.org/jira/browse/SLING-4116
> Project: Sling
> Issue Type: Bug
> Components: JCR
> Affects Versions: JCR Resource 2.3.12
> Reporter: Robert Munteanu
> Assignee: Carsten Ziegeler
> Fix For: JCR Resource 2.3.14
>
>
> As reported by [~dsuess] on [dev@sling - ResourceWrapper issue with
> ResourceMetadata|http://sling-dev.markmail.org/thread/aauecevkxjnbk4vi] , the
> code trying to guess the content-length can cause ItemNotFoundExceptions to
> be logged by calling {{Item.getPrimaryItem()}}.
> By looking at the Jackrabbit and Oak implementations, the getPrimaryItem()
> method does the following
> {code:java}
> String name = getPrimaryNodeType().getPrimaryItemName();
> if (name == null) {
> throw new ItemNotFoundException();
> }
> if (hasProperty(name)) {
> return getProperty(name);
> } else if (hasNode(name)) {
> return getNode(name);
> } else {
> throw new ItemNotFoundException();
> }
> {code}
> We should replicate this check to make sure that we no longer cause these
> exceptions to be thrown and logged.
--
This message was sent by Atlassian JIRA
(v6.3.4#6332)