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

Robert Munteanu commented on SLING-7811:
----------------------------------------

The {{SecurityProviderRegistration}} (SPR) already has the needed 
{{AuthorizableActionProvider}} (AAP). The problematic sequence is:
 * AAP bound to SPR
 * SPR registers {{SecurityProvider}}
 * Configuration is found for AAP
 * AAP unbound from SPR
 * SPR unregisters {{SecurityProvider}}
 * *Repository startup interrupted*
 * AAP deactivated
 * AAP activated with configuration
 * AAP bound to SPR
 * SPR registers {{SecurityProvider}} again

The SPR actually has more references, all of which can trigger this behaviour. 
With the following patch, the restart problem no longer occurs:
{noformat}
diff --git a/src/main/provisioning/oak.txt b/src/main/provisioning/oak.txt
index 5d2675c..5af546c 100644
--- a/src/main/provisioning/oak.txt
+++ b/src/main/provisioning/oak.txt
@@ -76,11 +76,6 @@
   org.apache.jackrabbit.oak.security.user.RandomAuthorizableNodeName
     length=I"21"
 
-  
org.apache.jackrabbit.oak.spi.security.user.action.DefaultAuthorizableActionProvider
-    
enabledActions=["org.apache.jackrabbit.oak.spi.security.user.action.AccessControlAction"]
-    userPrivilegeNames=["jcr:all"]
-    groupPrivilegeNames=["jcr:read"]
-
 [configurations runModes=oak_tar]
   org.apache.jackrabbit.oak.segment.SegmentNodeStoreService
     name="Default\ NodeStore"
{noformat}

But obviously that's not desireable :-)

So I guess we can't use the same mechanism as for the {{LoginAdminWhitelist}} 
as the references are already there.

> NPE when repository is starting up due to repository manager shutdown
> ---------------------------------------------------------------------
>
>                 Key: SLING-7811
>                 URL: https://issues.apache.org/jira/browse/SLING-7811
>             Project: Sling
>          Issue Type: Bug
>          Components: JCR
>    Affects Versions: JCR Oak Server 1.1.4, JCR Base 3.0.4
>            Reporter: Carsten Ziegeler
>            Assignee: Robert Munteanu
>            Priority: Major
>             Fix For: JCR Base 3.0.6, JCR Oak Server 1.2.2
>
>
> With the latest Sling Starter, the following NPE occurs in the logs. It seems 
> to be harmless, nevertheless we should fix it:
> For now I assigned it to both, JCR Base and Oak Server, as it's unclear which 
> one it is. Interestingly we've released Oak Server 1.2.0 but are not using it 
> in the starter.
> {noformat}
> 06.08.2018 15:45:18.396 *ERROR* [Apache Sling Repository Startup Thread] 
> org.apache.sling.jcr.oak.server.internal.OakSlingRepositoryManager start: 
> Uncaught Throwable trying to access Repository, calling stopRepository()
> java.lang.NullPointerException: null
>         at 
> com.google.common.base.Preconditions.checkNotNull(Preconditions.java:192) 
> [com.google.guava:15.0.0]
>         at org.apache.jackrabbit.oak.jcr.Jcr.with(Jcr.java:296) 
> [org.apache.jackrabbit.oak-jcr:1.6.8]
>         at 
> org.apache.sling.jcr.oak.server.internal.OakSlingRepositoryManager.acquireRepository(OakSlingRepositoryManager.java:161)
>  [org.apache.sling.jcr.oak.server:1.1.4]
>         at 
> org.apache.sling.jcr.base.AbstractSlingRepositoryManager.initializeAndRegisterRepositoryService(AbstractSlingRepositoryManager.java:471)
>  [org.apache.sling.jcr.base:3.0.4]
>         at 
> org.apache.sling.jcr.base.AbstractSlingRepositoryManager.access$300(AbstractSlingRepositoryManager.java:85)
>  [org.apache.sling.jcr.base:3.0.4]
>         at 
> org.apache.sling.jcr.base.AbstractSlingRepositoryManager$4.run(AbstractSlingRepositoryManager.java:455)
>  [org.apache.sling.jcr.base:3.0.4]
> {noformat}
> The stack trace points to a null workspace name ( see 
> https://github.com/apache/jackrabbit-oak/blob/jackrabbit-oak-1.6.8/oak-jcr/src/main/java/org/apache/jackrabbit/oak/jcr/Jcr.java#L296
>  ).



--
This message was sent by Atlassian JIRA
(v7.6.3#76005)

Reply via email to