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

Alexander Klimetschek commented on OAK-2956:
--------------------------------------------

Problem (after I deleted the groups and it still didn't want to install) was 
that the UUID was wrong, I chose it myself (manually changed a few chars), but 
in fact it is based on the authorizable ID, and because I changed that, it had 
to be adapted as well. So the only way is to create the user on the server and 
then copy the content with the right UUID into the package. Unfortunately, one 
has to provide a jcr:uuid in the .content.xml – it would be nice if this could 
be left out. Same for rep:principalName (so much duplication in the sources).

> NPE in UserImporter when importing group with modified authorizable id
> ----------------------------------------------------------------------
>
>                 Key: OAK-2956
>                 URL: https://issues.apache.org/jira/browse/OAK-2956
>             Project: Jackrabbit Oak
>          Issue Type: Bug
>          Components: core
>    Affects Versions: 1.2.2
>            Reporter: Alexander Klimetschek
>
> When importing a file vault package with a group that exists before (same 
> uuid in the .content.xml) but modified authorizable id, this NPE happens:
> {noformat}
> Caused by: java.lang.NullPointerException: null
>       at 
> org.apache.jackrabbit.oak.security.user.UserImporter.handlePropInfo(UserImporter.java:242)
>       at 
> org.apache.jackrabbit.oak.jcr.xml.ImporterImpl.importProperties(ImporterImpl.java:287)
>       at 
> org.apache.jackrabbit.oak.jcr.xml.ImporterImpl.startNode(ImporterImpl.java:470)
>       at 
> org.apache.jackrabbit.oak.jcr.xml.SysViewImportHandler.processNode(SysViewImportHandler.java:80)
>       at 
> org.apache.jackrabbit.oak.jcr.xml.SysViewImportHandler.startElement(SysViewImportHandler.java:117)
>       at 
> org.apache.jackrabbit.oak.jcr.xml.ImportHandler.startElement(ImportHandler.java:183)
>       at 
> org.apache.jackrabbit.vault.fs.impl.io.JcrSysViewTransformer.startNode(JcrSysViewTransformer.java:167)
>       at 
> org.apache.jackrabbit.vault.fs.impl.io.DocViewSAXImporter.startElement(DocViewSAXImporter.java:598)
>       ... 87 common frames omitted
> {noformat}
> It looks like [this 
> line|https://github.com/apache/jackrabbit-oak/blob/105f890e04ee990f0e71d88937955680670d96f7/oak-core/src/main/java/org/apache/jackrabbit/oak/security/user/UserImporter.java#L242],
>  meaning {{userManager.getAuthorizable(id)}} returned null.
> While the use case might not be something to support (this happens during 
> development, changing group names/details until "right"), at least the NPE 
> should be guarded against and a better error message given.
> Looking closer, it seems like a difference between 
> {{UserManager.getAuthorizable(Tree)}} (called earlier in the method) (I 
> assume using UUID to look up the existing group successfully) and 
> {{UserManager.getAuthorizable(String)}} (using the rep:authorizableId to look 
> up the user, failing, because it changed).



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)

Reply via email to