ALF-19924 IllegalStateException: Unauthenticated during upgrade from 3.4.X to HEAD build 1451

Run as System on bootstrap.



git-svn-id: https://svn.alfresco.com/repos/alfresco-enterprise/alfresco/HEAD/root@55144 c4b6b30b-aa2e-2d43-bbcb-ca4b014f7261
This commit is contained in:
Pavel Yurke
2013-09-09 16:23:55 +00:00
parent 51cfadf277
commit fce64e27a9

View File

@@ -30,6 +30,8 @@ import org.alfresco.repo.importer.ImporterBootstrap;
import org.alfresco.repo.node.index.FullIndexRecoveryComponent.RecoveryMode;
import org.alfresco.repo.search.AVMSnapShotTriggeredIndexingMethodInterceptorImpl;
import org.alfresco.repo.search.IndexMode;
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.repository.ContentReader;
import org.alfresco.service.cmr.repository.ContentService;
@@ -174,10 +176,16 @@ public class ConfigurationChecker extends AbstractLifecycleBean
{
RetryingTransactionCallback<Object> checkWork = new RetryingTransactionCallback<Object>()
{
public Object execute() throws Exception
{
check();
return null;
public Object execute() throws Throwable {
// run as System on bootstrap
return AuthenticationUtil.runAs(new RunAsWork<Object>()
{
public Object doWork()
{
check();
return null;
}
}, AuthenticationUtil.getSystemUserName());
}
};
transactionService.getRetryingTransactionHelper().doInTransaction(checkWork, true);