Uploaded image for project: 'Jackrabbit Oak'
  1. Jackrabbit Oak
  2. OAK-9956

javax.jcr.Node.addNode(...) throws javax.jcr.PathNotFoundException for any unmapped namespaces in expanded path notation

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Open
    • Major
    • Resolution: Unresolved
    • 1.44.0
    • None
    • None
    • None

    Description

      In case Node.addNode(...) is called with a path in expanded form containing a namespace URI which is not mapped a javax.jcr.PathNotFoundException is thrown. This is unexpected as the JCR 2.0 spec allows unmapped namespaces according to https://developer.adobe.com/experience-manager/reference-materials/spec/jcr/2.0/3_Repository_Model.html#3.5.2%20Session-Local%20Mappings and https://developer.adobe.com/experience-manager/reference-materials/spec/jcr/2.0/3_Repository_Model.html#3.4.3.4%20Parsing%20Lexical%20Paths

      When parsing a lexical path, the parser must distinguish between name segments that are in expanded form and those that are in qualified form (see §3.2.5 Lexical Form of JCR Names). When making this determination, the repository cannot assume that every namespace URI encountered in an expanded name will be registered within the repository.

      An otherwise valid path containing an expanded name with an unregistered namespace URI will always resolve into a valid internal representation of a path (i.e., an ordered list of path segments, see §3.4 Paths). Any errors that arise from passing such a path must therefore be as a result of further processing (not merely parsing) that depends on the semantics of the path and the context of use.

      The same exception is thrown if there is a prefix only locally registered via Session.setNamespacePrefix(....) for both cases when calling addNode(...) afterwards in either qualified or expanded form.

      Attachments

        1. OAK-9956.diff
          3 kB
          Julian Reschke

        Issue Links

          Activity

            People

              reschke Julian Reschke
              kwin Konrad Windszus
              Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

              Dates

                Created:
                Updated: