[
https://issues.apache.org/jira/browse/OAK-2956?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=14592291#comment-14592291
]
Alexander Klimetschek commented on OAK-2956:
--------------------------------------------
I am using this to define an application group (not to sync content between
existing systema) and we don't have LDAP at all. Since the XML is also the
source code, the enforced duplication means it is fragile (another dev could
change the principal name when that should not be the case) and including the
uuid means I am including repository implementation details in my sources. The
package should have a declarative format that works like
UserManager.createUser() and provides only the minimal required input (and
where the principal name = user id). If I want a different principal name, I
could specify it.
> 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: Improvement
> Components: core
> Affects Versions: 1.2.2
> Reporter: Alexander Klimetschek
> Priority: Minor
>
> 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)