mirror of
https://github.com/Alfresco/alfresco-community-repo.git
synced 2025-08-07 17:49:17 +00:00
Merged V3.3-BUG-FIX to HEAD
24179: ALF-6017: During bootstrap rules are being triggered when ModuleServiceImpl.startModules() transaction is committed but there is no authentication at that point. Merge fixes ALF-6831: Module startup fails with AuthenticationCredentialsNotFoundException git-svn-id: https://svn.alfresco.com/repos/alfresco-enterprise/alfresco/HEAD/root@25016 c4b6b30b-aa2e-2d43-bbcb-ca4b014f7261
This commit is contained in:
@@ -18,6 +18,8 @@
|
||||
*/
|
||||
package org.alfresco.repo.module;
|
||||
|
||||
import org.alfresco.repo.security.authentication.AuthenticationUtil;
|
||||
import org.alfresco.repo.security.authentication.AuthenticationUtil.RunAsWork;
|
||||
import org.alfresco.repo.transaction.RetryingTransactionHelper.RetryingTransactionCallback;
|
||||
import org.alfresco.service.cmr.module.ModuleService;
|
||||
import org.alfresco.service.transaction.TransactionService;
|
||||
@@ -57,7 +59,7 @@ public class ModuleStarter extends AbstractLifecycleBean
|
||||
protected void onBootstrap(ApplicationEvent event)
|
||||
{
|
||||
PropertyCheck.mandatory(this, "moduleService", moduleService);
|
||||
RetryingTransactionCallback<Object> startModulesCallback = new RetryingTransactionCallback<Object>()
|
||||
final RetryingTransactionCallback<Object> startModulesCallback = new RetryingTransactionCallback<Object>()
|
||||
{
|
||||
public Object execute() throws Throwable
|
||||
{
|
||||
@@ -65,8 +67,17 @@ public class ModuleStarter extends AbstractLifecycleBean
|
||||
return null;
|
||||
}
|
||||
};
|
||||
transactionService.getRetryingTransactionHelper().doInTransaction(startModulesCallback,
|
||||
transactionService.isReadOnly());
|
||||
|
||||
AuthenticationUtil.runAs(new RunAsWork<Object>()
|
||||
{
|
||||
@Override
|
||||
public Object doWork() throws Exception
|
||||
{
|
||||
transactionService.getRetryingTransactionHelper().doInTransaction(startModulesCallback, transactionService.isReadOnly());
|
||||
return null;
|
||||
}
|
||||
|
||||
}, AuthenticationUtil.getSystemUserName());
|
||||
}
|
||||
|
||||
@Override
|
||||
|
Reference in New Issue
Block a user