mirror of
https://github.com/Alfresco/alfresco-community-repo.git
synced 2025-10-08 14:51:49 +00:00
Merge branch 'feature/RM-3708_LDAP_startup_error' into 'master'
Feature/rm 3708 ldap startup error RM-3708 - [LDAP] Exception "NodeRef may not be null for calls to NodeService" is thrown in logs The error is thrown when the application tries to run the disposition jobs as "$\{audit.rm.runas\}". When the value is not present in any property file the value is not interpreted. This only reproduces when using some authentication chains because the authentication service is not reliable to check if a person exists. Some implementations of it just return true (AuthenticationServiceImpl) and some of them, in the best case scenario, reach person service to make the check. As a fix I replaced authentication service with person service. See merge request !378
This commit is contained in:
@@ -85,7 +85,7 @@
|
||||
|
||||
<property name="nodeService" ref="nodeService" />
|
||||
<property name="searchService" ref="searchService" />
|
||||
<property name="authenticationService" ref="authenticationService" />
|
||||
<property name="personService" ref="personService" />
|
||||
<property name="recordsManagementActionService" ref="recordsManagementActionService" />
|
||||
</bean>
|
||||
|
||||
|
@@ -43,7 +43,7 @@ import org.alfresco.service.cmr.repository.NodeService;
|
||||
import org.alfresco.service.cmr.repository.StoreRef;
|
||||
import org.alfresco.service.cmr.search.ResultSet;
|
||||
import org.alfresco.service.cmr.search.SearchService;
|
||||
import org.alfresco.service.cmr.security.AuthenticationService;
|
||||
import org.alfresco.service.cmr.security.PersonService;
|
||||
import org.apache.commons.logging.Log;
|
||||
import org.apache.commons.logging.LogFactory;
|
||||
|
||||
@@ -74,8 +74,8 @@ public class DispositionLifecycleJobExecuter extends RecordsManagementJobExecute
|
||||
/** search service */
|
||||
private SearchService searchService;
|
||||
|
||||
/** authenticationService service */
|
||||
private AuthenticationService authenticationService;
|
||||
/** person service */
|
||||
private PersonService personService;
|
||||
|
||||
/**
|
||||
* List of disposition actions to automatically execute when eligible.
|
||||
@@ -241,13 +241,13 @@ public class DispositionLifecycleJobExecuter extends RecordsManagementJobExecute
|
||||
}
|
||||
}
|
||||
|
||||
public AuthenticationService getAuthenticationService()
|
||||
public PersonService getPersonService()
|
||||
{
|
||||
return authenticationService;
|
||||
return personService;
|
||||
}
|
||||
|
||||
public void setAuthenticationService(AuthenticationService authenticationService)
|
||||
public void setPersonService(PersonService personService)
|
||||
{
|
||||
this.authenticationService = authenticationService;
|
||||
this.personService = personService;
|
||||
}
|
||||
}
|
||||
|
@@ -129,10 +129,8 @@ public class RecordsManagementJob implements Job
|
||||
if (jobExecuter instanceof DispositionLifecycleJobExecuter)
|
||||
{
|
||||
String auditUser = (String) context.getJobDetail().getJobDataMap().get("runAuditAs");
|
||||
if (((DispositionLifecycleJobExecuter) jobExecuter).getAuthenticationService()
|
||||
.authenticationExists(auditUser))
|
||||
if (((DispositionLifecycleJobExecuter) jobExecuter).getPersonService().getPersonOrNull(auditUser) != null)
|
||||
{
|
||||
|
||||
setRunAuditAs(auditUser);
|
||||
}
|
||||
else
|
||||
|
Reference in New Issue
Block a user