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

Julian Reschke updated OAK-11487:
---------------------------------
    Epic Link: OAK-11659

> Node.addNode(ExpandedName) fails with RepositoryException for unknown 
> namespace URIs
> ------------------------------------------------------------------------------------
>
>                 Key: OAK-11487
>                 URL: https://issues.apache.org/jira/browse/OAK-11487
>             Project: Jackrabbit Oak
>          Issue Type: Bug
>            Reporter: Konrad Windszus
>            Priority: Major
>
> According to 
> [https://developer.adobe.com/experience-manager/reference-materials/spec/jcr/2.0/3_Repository_Model.html#3.5.1%20Namespace%20Registry]
> {quote}there may be repository content with namespaces that are not included 
> in the registry
> {quote}
> However when creating a new node with 
> {code}
> Node.addNode("{http://foo.com}bar";)
> {code}
>  (an expanded name for which no prefix is registered, neither locally in the 
> session nor globally) the following exception is thrown:
> {code:java}
> javax.jcr.RepositoryException: cannot determine oak path for: 
> {http://foo.com}bar
>       at 
> org.apache.jackrabbit.oak.jcr.session.NodeImpl.addNode(NodeImpl.java:278)
>       at 
> org.apache.jackrabbit.oak.jcr.session.NodeImpl.addNode(NodeImpl.java:267)
>       ...
> Caused by: javax.jcr.PathNotFoundException: {http://foo.com}bar
>       at 
> org.apache.jackrabbit.oak.jcr.session.SessionContext.getOakPathOrThrowNotFound(SessionContext.java:400)
>       at 
> org.apache.jackrabbit.oak.jcr.session.ItemImpl.getOakPathOrThrowNotFound(ItemImpl.java:333)
>       at 
> org.apache.jackrabbit.oak.jcr.session.NodeImpl.addNode(NodeImpl.java:276)
>       ... 23 more
> {code}
> .
> Also in 
> [https://developer.adobe.com/experience-manager/reference-materials/spec/jcr/2.0/3_Repository_Model.html#3.5.2%20Session-Local%20Mappings]
>  it is stated
> {quote}If a JCR method returns a name from the repository with a namespace 
> URI for which no local mapping exists, a prefix is created automatically and 
> a mapping between that prefix and the namespace URI in question is added to 
> the set of local mappings. The new prefix must differ from those already 
> present among the set of local mappings.
> {quote}



--
This message was sent by Atlassian Jira
(v8.20.10#820010)

Reply via email to