Expand my Community achievements bar.

Don’t miss the AEM Skill Exchange in SF on Nov 14—hear from industry leaders, learn best practices, and enhance your AEM strategy with practical tips.
SOLVED

Null Pointer Exceptions from Workflow Related URLs

Avatar

Level 4

We've created a new instance of CQ and wanted it to mirror another already existing instance. We packaged /apps, /etc/designs, and /etc/workflow in the old instance and installed it in the new instance. Everything seemed to be going well but we've found that whenever a url is hit that tries to use the WorkflowSessionFactory class, it throws a null pointer exception. This doesn't happen with the admin user account, everything works fine. Even if i create a new user and give it access to everything, the URLs will fail (i'm assuming because it isn't a super user). What would cause this method to throw a null pointer? I've listed examples below -

 

(From a content page)
/libs/wcm/core/content/pageinfo.json?path=/content

org.apache.sling.engine.impl.SlingRequestProcessorImpl service: Uncaught Throwable java.lang.NullPointerException at com.adobe.granite.workflow.core.WorkflowSessionFactory.isSuperUser(WorkflowSessionFactory.java:278) at com.adobe.granite.workflow.core.WorkflowSessionFactory.getWorkflowSession(WorkflowSessionFactory.java:304) at com.adobe.granite.workflow.core.WorkflowSessionFactory.getAdapter(WorkflowSessionFactory.java:435) at org.apache.sling.adapter.internal.AdapterManagerImpl.getAdapter(AdapterManagerImpl.java:140) at com.day.cq.workflow.impl.CQWorkflowService.getWorkflowSession(CQWorkflowService.java:148) at com.day.cq.wcm.core.impl.DefaultPageStatusProvider.updatePageInfo(DefaultPageStatusProvider.java:146) at com.day.cq.wcm.core.impl.servlets.PageInfoServlet.doGet(PageInfoServlet.java:187)

(From the workflow console)
/libs/cq/workflow/content/console/instances.json

Caused by: java.lang.NullPointerException at com.adobe.granite.workflow.core.WorkflowSessionFactory.isSuperUser(WorkflowSessionFactory.java:278) at com.adobe.granite.workflow.core.WorkflowSessionFactory.getWorkflowSession(WorkflowSessionFactory.java:304) at com.adobe.granite.workflow.core.WorkflowSessionFactory.getAdapter(WorkflowSessionFactory.java:435) at org.apache.sling.adapter.internal.AdapterManagerImpl.getAdapter(AdapterManagerImpl.java:140) at com.day.cq.workflow.impl.CQWorkflowService.getWorkflowSession(CQWorkflowService.java:148) at org.apache.jsp.libs.cq.workflow.components.console.instances.json_jsp._jspService(json_jsp.java:134)

(Also from workflow console)
/libs/cq/workflow/content/console/archive.json

Caused by: java.lang.NullPointerException at com.adobe.granite.workflow.core.WorkflowSessionFactory.isSuperUser(WorkflowSessionFactory.java:278) at com.adobe.granite.workflow.core.WorkflowSessionFactory.getWorkflowSession(WorkflowSessionFactory.java:304) at com.adobe.granite.workflow.core.WorkflowSessionFactory.getAdapter(WorkflowSessionFactory.java:435) at org.apache.sling.adapter.internal.AdapterManagerImpl.getAdapter(AdapterManagerImpl.java:140) at com.day.cq.workflow.impl.CQWorkflowService.getWorkflowSession(CQWorkflowService.java:148) at org.apache.jsp.libs.cq.workflow.components.console.archive.json_jsp._jspService(json_jsp.java:129)

I don't think there is anything wrong with the nodes, as everything works as expected for admin. But it doesn't seem like a permissions problem because the user i created with all permissions still didn't work.

Thanks

1 Accepted Solution

Avatar

Correct answer by
Level 4

Finally figured this out, in case anyone else runs into this - The problem ended up being that at some point during server set up the "administrators" group was deleted. I'm assuming the method "isSuperUser()" by default looks for that group so when it didn't find it, threw a null pointer. After re-creating the "administrators" group everything is working as expected.

View solution in original post

2 Replies

Avatar

Correct answer by
Level 4

Finally figured this out, in case anyone else runs into this - The problem ended up being that at some point during server set up the "administrators" group was deleted. I'm assuming the method "isSuperUser()" by default looks for that group so when it didn't find it, threw a null pointer. After re-creating the "administrators" group everything is working as expected.

Avatar

Level 8

Glad you solved the problem. Thanks for following up and letting us know the solution.

scott