Uploaded image for project: 'Jackrabbit Content Repository'
  1. Jackrabbit Content Repository
  2. JCR-3271

NPE in CompiledPermissionImpl

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Open
    • Minor
    • Resolution: Unresolved
    • 2.2
    • None
    • jackrabbit-core
    • None

    Description

      Every now and then I see a NullPointerException in CompiledPermissionImpl
      when events are delivered from another cluster node:

      java.lang.NullPointerException
      at org.apache.jackrabbit.core.security.authorization.acl.CompiledPermissionsImpl.canRead(CompiledPermissionsImpl.java:215)
      at org.apache.jackrabbit.core.security.DefaultAccessManager.canRead(DefaultAccessManager.java:251)
      at org.apache.jackrabbit.core.observation.EventConsumer.canRead(EventConsumer.java:306)
      at org.apache.jackrabbit.core.observation.EventConsumer.prepareEvents(EventConsumer.java:158)
      at org.apache.jackrabbit.core.observation.ObservationDispatcher.prepareEvents(ObservationDispatcher.java:184)
      at org.apache.jackrabbit.core.observation.EventStateCollection.prepare(EventStateCollection.java:459)
      at org.apache.jackrabbit.core.observation.DelegatingObservationDispatcher.dispatch(DelegatingObservationDispatcher.java:126)
      at org.apache.jackrabbit.core.observation.DelegatingObservationDispatcher.dispatchEvents(DelegatingObservationDispatcher.java:99)
      at org.apache.jackrabbit.core.observation.EventStateCollection.dispatch(EventStateCollection.java:475)
      at org.apache.jackrabbit.core.state.SharedItemStateManager.externalUpdate(SharedItemStateManager.java:1526)
      at org.apache.jackrabbit.core.version.InternalVersionManagerImpl.externalUpdate(InternalVersionManagerImpl.java:633)
      at org.apache.jackrabbit.core.cluster.ClusterNode.process(ClusterNode.java:813)
      at org.apache.jackrabbit.core.cluster.ChangeLogRecord.process(ChangeLogRecord.java:498)
      at org.apache.jackrabbit.core.cluster.ClusterNode.consume(ClusterNode.java:759)
      at org.apache.jackrabbit.core.journal.AbstractJournal.doSync(AbstractJournal.java:233)
      at org.apache.jackrabbit.core.journal.AbstractJournal.internalSync(AbstractJournal.java:207)
      at org.apache.jackrabbit.core.journal.AbstractJournal.sync(AbstractJournal.java:190)
      at org.apache.jackrabbit.core.cluster.ClusterNode.sync(ClusterNode.java:307)
      at org.apache.jackrabbit.core.cluster.ClusterNode.run(ClusterNode.java:272)
      at java.lang.Thread.run(Thread.java:662)

      The contract for DefaultAccessManager.canRead() is not quite clear on
      whether it is allowed to check for read permission on an item that does
      not exist, which is the case here.

      AccessManager.canRead(Path itemPath, ItemId itemId) in 2.2 says it
      should only be called for persisted items and the method would
      throw a RepositoryException for NEW items, which is similar to
      an item that doesn't exist anymore. In both cases it is basically
      inexistent for the system session used to perform the check.

      I think CompiledPermissionsImpl.canRead(Path path, ItemId itemId)
      should throw a RepositoryException if it cannot resolve the given
      path to an id.

      Attachments

        Activity

          People

            Unassigned Unassigned
            mreutegg Marcel Reutegger
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

              Created:
              Updated: