Solved
AEM6.1 Service User Issue
Hello,
We have been working with AEM 6.0SP2 and are now moving into AEM 6.1.
During our upgrade from CQ 5.6.1 to AEM 6.0SP2 we converted over all our uses of admin sessions (via resourceResolver. loginAdministrative()) to use service users instead.
Here's a snippet of how we get a service user:
try { Map<String, Object> param = new HashMap<String, Object>(); param.put(ResourceResolverFactory.SUBSERVICE, "contentReadService"); this.serviceResourceResolver = this.resourceResolverFactory.getServiceResourceResolver(param); if (this.serviceResourceResolver != null) { LOG.debug("New resource resolver found"); } } catch (LoginException e) { LOG.error("error getting resource resolver"); LOG.error(e.getMessage()); }
By the above code we should be looking for the "contentReadService" subservice from the current bundle (we'll call the bundle XXX).
In the "Apache Sling Service User Mapping Service" we have the following configuration:
So my understanding is that the "contentReadService" in the bundle "XXX" should be assigned the user "service_content_read". This user does exist.XXX:contentReadService=service_content_read
This worked great in AEM 6.0SP2, but as of AEM 6.1 i see the following error in the log:
02.06.2015 10:28:51.802 *ERROR* [qtp1426607298-4062] error getting resource resolver02.06.2015 10:28:51.802 *ERROR* [qtp1426607298-4062] Cannot derive user name for bundle XXX [449] and sub service contentReadService
We can see from the code that the "error getting resource resolver" is something i'm putting in, so the following error is the error message of the LoginException in that final catch block.
Has anyone experienced a similar issue?
Thanks,
Kyle