2

I have a bundle that was working completely fine in AEM 6. I just upgraded to AEM 6.1 and when I deploy the bundle, I'm getting the error below:

javax.jcr.LoginException: Cannot derive user name for bundle org.demo.anthony.mybundle.core [446] and sub service null at org.apache.sling.jcr.base.AbstractSlingRepository2.loginService(AbstractSlingRepository2.java:336) at org.demo.anthony.mybundle.core.impl.EvernoteSyncServiceImpl.getSession(EvernoteSyncServiceImpl.java:108) at org.demo.anthony.mybundle.core.impl.EvernoteSyncServiceImpl.syncNotes(EvernoteSyncServiceImpl.java:201) at org.demo.anthony.mybundle.core.impl.EvernoteSyncServiceImpl.syncWebClipperNotes(EvernoteSyncServiceImpl.java:174) at org.demo.nennig.evernote.core.impl.schedulers.EvernoteSyncTask.run(EvernoteSyncTask.java:96) at org.apache.sling.commons.scheduler.impl.QuartzJobExecutor.execute(QuartzJobExecutor.java:105) at org.quartz.core.JobRunShell.run(JobRunShell.java:202) at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1110) at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:603) at java.lang.Thread.run(Thread.java:722)

This is how I'm getting hold of the session (this is line 108 in the code as referenced in the stacktrace):

session = repository.loginService(null, null);
Anthony
  • 33,838
  • 42
  • 169
  • 278
  • This looks like a problem with service user mappings. Have you checked your _Apache Sling Service User Mapper Service_ configuration? Are the mappings still there after the migration? – toniedzwiedz Sep 05 '15 at 09:37

1 Answers1

1

Until AEM 6.0, the services were allowed to be accessed by default "admin" user. From 6.1, you have to specify a "system user" and/or another user for a specific service. You can define these mapping in Sling Service User Mapper

We had similar issues and below are some of my solutions, see if they'll help:

ResourceResolverFactory getServiceResourceResolver throws Exception in AEM 6.1

How to create a system user (rep:SystemUser) in AEM 6.1?

One more example from Adobe: https://helpx.adobe.com/experience-manager/using/querying-experience-manager-sling.html

Community
  • 1
  • 1
Suren Konathala
  • 3,497
  • 5
  • 43
  • 73