You are viewing a plain text version of this content. The canonical link for it is here.
Posted to oak-issues@jackrabbit.apache.org by "Miguel Moquillon (Jira)" <ji...@apache.org> on 2023/03/13 15:38:00 UTC

[jira] [Commented] (OAK-10143) Issue when oak-upgrade fetch all the namespaces from very old jackrabbit 2 repository

    [ https://issues.apache.org/jira/browse/OAK-10143?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17699708#comment-17699708 ] 

Miguel Moquillon commented on OAK-10143:
----------------------------------------

With some old jackrabbit 2 repositories, the 
{code:java}
JCR_HOME/repository/namespaces/ns_reg.properties{code}
file contains as namespace an empty string instead of the predefined name empty.key for empty namespace.

 

See attachments as an example.

In such circumstances, the upgrade of the Jackrabbit 2 JCR to the Oak one fails because the preconditions of a non null or a non empty property name isn't satisfied (checked by {_}AbstractNodeState#checkValidName(String){_}).

A way to avoid this is to check the emptiness of the _prefixHint_ variable in _RepositoryUpgrade#copyNamespaces(...)_ like this:
{code:java}
if (".empty.key".equals(prefixHint) || prefixHint.isEmpty()) {
    prefix = ""; // the default empty mapping is not stored
} else {
    prefix = addCustomMapping(namespaces, uri, prefixHint);
}{code}
 

> Issue when oak-upgrade fetch all the namespaces from very old jackrabbit 2 repository
> -------------------------------------------------------------------------------------
>
>                 Key: OAK-10143
>                 URL: https://issues.apache.org/jira/browse/OAK-10143
>             Project: Jackrabbit Oak
>          Issue Type: Bug
>            Reporter: Miguel Moquillon
>            Priority: Major
>




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