You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@sling.apache.org by "Carsten Ziegeler (JIRA)" <ji...@apache.org> on 2014/11/19 09:23:34 UTC

[jira] [Resolved] (SLING-4116) Content length check in JCRNodeResourceMetadata triggers javax.jcr.ItemNotFoundException: No primary item present on node

     [ https://issues.apache.org/jira/browse/SLING-4116?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Carsten Ziegeler resolved SLING-4116.
-------------------------------------
    Resolution: Fixed

> 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.4.0
>
>
> 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)