Null Pointer Exceptions from Workflow Related URLs | Community
Skip to main content
Level 3
October 16, 2015
Solved

Null Pointer Exceptions from Workflow Related URLs

  • October 16, 2015
  • 2 replies
  • 2162 views

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

This post is no longer active and is closed to new replies. Need help? Start a new post to ask your question.
Best answer by jocamp

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.

2 replies

jocampAuthorAccepted solution
Level 3
October 16, 2015

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.

Scott_Brodersen
Level 8
October 16, 2015

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

scott