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

Marcel Reutegger commented on OAK-8948:
---------------------------------------

Apologies, I was confused by line numbers because I was looking at 
ObservationManagerImpl in trunk. However, I'm still wondering what path values 
are passed via {{filter.getExcludedPaths()}}.

bq. method can return null if oakPath doesn't exist

It's fine when there is no item at the given path, but the PathMapper will 
return null when oakPath is _invalid_.

> PathUtils. unifyInExcludes throws NPE when 'exclude' is null
> ------------------------------------------------------------
>
>                 Key: OAK-8948
>                 URL: https://issues.apache.org/jira/browse/OAK-8948
>             Project: Jackrabbit Oak
>          Issue Type: Bug
>          Components: jackrabbit-api
>    Affects Versions: 1.8.17, 1.8.20
>            Reporter: rafiya sirin
>            Assignee: Marcel Reutegger
>            Priority: Major
>              Labels: Observation
>             Fix For: 1.8.21
>
>         Attachments: Screen Shot 2020-03-13 at 2.25.07 PM.png, stacktrace.txt
>
>
> While registering a resource change listener, we encountered the following 
> exception : 
>  
> {code:java}
> 05.03.2020 23:39:00.728 *ERROR* [FelixDispatchQueue] 
> org.apache.sling.resourceresolver FrameworkEvent ERROR 
> (java.lang.NullPointerException)
> java.lang.NullPointerException: null
> at 
> org.apache.jackrabbit.oak.commons.PathUtils.unifyInExcludes(PathUtils.java:501)
>  [org.apache.jackrabbit.oak-commons:1.8.17]
> at 
> org.apache.jackrabbit.oak.jcr.observation.ObservationManagerImpl.addEventListener(ObservationManagerImpl.java:240)
>  [org.apache.jackrabbit.oak-jcr:1.8.17]
> at 
> org.apache.sling.jcr.resource.internal.JcrListenerBaseConfig.register(JcrListenerBaseConfig.java:136)
>  [org.apache.sling.jcr.resource:3.0.16.1]
> {code}
>  
> On further debugging, we found that issues lies in this snippet : 
> {code:java}
> if (exclude.equals(include) || isAncestor(exclude, include)) {
>  includesRemoved.add(include);{code}
> 'exclude' can be null if the getOakPath() method returns a null. This NPE 
> causes listeners(ResourceChangeListener in our case) to fail at registration.



--
This message was sent by Atlassian Jira
(v8.3.4#803005)

Reply via email to