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

Manfred Baedke edited comment on OAK-12066 at 1/28/26 10:23 AM:
----------------------------------------------------------------

This happens during the very first query during the Oak initialization. Code 
analysis indicates that the null value comes from a NodeTypeInfo object n 
representing nt:base with both n.exists()==true and n.getNodeTypeName()==null, 
which would mean that the current tree contains an nt:base node without a 
jcr:nodeTypeName property. Since the Oak initialization up to this point seems 
to be completely linear, I don't understand how this is possible. For the 
moment I suggest to add a log statement to help with further analysis if this 
ever happens again (see attached PR#2708). This will not do anything more than 
verifying the code analysis, but I currently don't see what else we could do.


was (Author: baedke):
This happens during the very first query during the Oak initialization. Code 
analysis indicates that the null value comes from a NodeTypeInfo object n 
representing nt:base with both n.exists()==true and n.getNodeTypeName()==null, 
which would mean that the current tree contains an nt:base node without a 
jcr:nodeTypeName property. Since the Oak initialization up to this point seems 
to be completely linear, I don't understand how this is possible. For the 
moment I suggest to add a log statement to help with further analysis if this 
ever happens again.

> NPE in AstElement "quote()"
> ---------------------------
>
>                 Key: OAK-12066
>                 URL: https://issues.apache.org/jira/browse/OAK-12066
>             Project: Jackrabbit Oak
>          Issue Type: Bug
>          Components: query
>            Reporter: Julian Reschke
>            Assignee: Manfred Baedke
>            Priority: Minor
>
> See:
> {code}
> java.lang.NullPointerException
>       at 
> java.base/java.lang.StringConcatHelper.stringOf(StringConcatHelper.java)
>       at 
> org.apache.jackrabbit.oak.query.ast.SelectorImpl.toString(SelectorImpl.java:261)
>       at 
> org.apache.jackrabbit.oak.query.ast.SelectorImpl.getPlan(SelectorImpl.java:414)
>       at org.apache.jackrabbit.oak.query.QueryImpl.getPlan(QueryImpl.java:703)
>       at org.apache.jackrabbit.oak.query.QueryImpl.getRows(QueryImpl.java:610)
>       at 
> org.apache.jackrabbit.oak.plugins.identifier.IdentifierManager.resolveUUIDToTree(IdentifierManager.java:350)
>       at 
> org.apache.jackrabbit.oak.plugins.identifier.IdentifierManager.getTree(IdentifierManager.java:132)
>       at 
> org.apache.jackrabbit.oak.security.user.AuthorizableBaseProvider.getByContentID(AuthorizableBaseProvider.java:59)
>       at 
> org.apache.jackrabbit.oak.security.user.AuthorizableBaseProvider.getByID(AuthorizableBaseProvider.java:54)
>       at 
> org.apache.jackrabbit.oak.security.user.UserProvider.getAuthorizable(UserProvider.java:208)
>       at 
> org.apache.jackrabbit.oak.security.user.UserManagerImpl.getAuthorizable(UserManagerImpl.java:125)
>       at 
> org.apache.jackrabbit.oak.security.user.UserInitializer.initialize(UserInitializer.java:141)
>       at 
> org.apache.jackrabbit.oak.OakInitializer.initialize(OakInitializer.java:62)
>       at org.apache.jackrabbit.oak.Oak.initialContent(Oak.java:721)
>       at 
> org.apache.jackrabbit.oak.Oak.createNewContentRepository(Oak.java:751)
>       at org.apache.jackrabbit.oak.Oak.createContentRepository(Oak.java:691)
>       at 
> org.apache.jackrabbit.oak.jcr.Jcr.createContentRepository(Jcr.java:389)
>       at org.apache.jackrabbit.oak.jcr.Jcr.createRepository(Jcr.java:398)
>       at 
> org.apache.jackrabbit.oak.jcr.document.GetMixinNodeTypesTest.before(GetMixinNodeTypesTest.java:60)
> {code}
> Apparently
> https://github.com/apache/jackrabbit-oak/blob/7e7a557106a44721c2f34db7a2c4a6f1f34a67a4/oak-core/src/main/java/org/apache/jackrabbit/oak/query/ast/AstElement.java#L44
> is invoked with {{null}}.
> This happened while testing with DB2, maybe a timing problem?
> (maybe it would help to add nullability annotations)



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

Reply via email to