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.

Unlock Payload Process throwing Null Pointer Exception

Avatar

Level 2

Hi,

We are upgrading from AEM 6.0 to AEM 6.2 . I see that Unlock Payload Process in the custom workflow is throwing Null Pointer Exception in Dynamic Participant step.

This custom workflow is triggered  by a scheduler  as below  and the session object  passed to create the workflow is obtained from serviceResourceResolver.

Can someone suggest how to resolve this.

  WorkflowSession wfSession = workflowService.getWorkflowSession(session);

        // Get the workflow model

        WorkflowModel wfModel = wfSession.getModel(wfModelDefn);

        if (wfModel != null) {

            // Get the workflow data

            // The first param in the newWorkflowData method is the payloadType.  Just a fancy name to let it know what type of workflow it is working with.

            WorkflowData wfData = wfSession.newWorkflowData("JCR_PATH", absContentPath);

            if (wfData != null) {

                // Run the Workflow.

                wfSession.startWorkflow(wfModel, wfData);

                LOG.debug("Workflow started for for mlc review : {}", absContentPath);

            }

java.lang.NullPointerException

Unlock Payload Process

com.adobe.granite.workflow.WorkflowException: java.lang.NullPointerException
at com.adobe.granite.workflow.core.advance.ParticipantNodeHandler.doTransition(ParticipantNodeHandler.java:198)
at com.adobe.granite.workflow.core.advance.AdvanceUtil.transitionFrom(AdvanceUtil.java:143)
at com.adobe.granite.workflow.core.WorkflowSessionImpl.completeInternal(WorkflowSessionImpl.java:951)
at com.adobe.granite.workflow.core.job.HandlerBase.complete(HandlerBase.java:507)
at com.adobe.granite.workflow.core.job.JobHandler.process(JobHandler.java:348)
at org.apache.sling.event.impl.jobs.JobConsumerManager$JobConsumerWrapper.process(JobConsumerManager.java:500)
at org.apache.sling.event.impl.jobs.queues.JobQueueImpl.startJob(JobQueueImpl.java:291)
at org.apache.sling.event.impl.jobs.queues.JobQueueImpl.access$100(JobQueueImpl.java:58)
at org.apache.sling.event.impl.jobs.queues.JobQueueImpl$1.run(JobQueueImpl.java:227)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624)
at java.lang.Thread.run(Thread.java:748)
Caused by: java.lang.NullPointerException

4 Replies

Avatar

Community Advisor

Dear Priya,

Are you using LockManager[1] to unlock pages. isLocked and unlock methods which are responsible for unlocking.

Please note if LockManger fails you can always remove Lock's via even lower interface Node[1] method removeMixin and setProperty allow to change lock's.

[1] LockManager (Content Repository for Java Technology API Version 2.0)

Regards,

Peter

Avatar

Community Advisor

Dear Priya,

Are you using LockManager[1] to unlock pages. isLocked and unlock methods which are responsible for unlocking.

Please note if LockManger fails you can always remove Lock's via even lower interface Node[2] method removeMixin and setProperty allow to change lock's.

[1] LockManager (Content Repository for Java Technology API Version 2.0)

[2] Node (Content Repository for Java Technology API Version 2.0)

Regards,

Peter

Avatar

Community Advisor

Hi,

Could you please try below settings

Workflow lock/ unlock steps not working in AEM 6.3

To apply configurations to allow the Lock/ Unlock processes to function in AEM 6.3, follow these steps:

  Go to http://host:port/system/console/configMgr.

  Find Day CQ Workflow Service.

  Mark Enable Lock/Unlock Process to true.

  Click Save.

  Find Adobe Granite Repository Service User Configuration, and add a new configuration.

  Set Simple Subject Population to true.

  Set Service Users to workflow-process-service.

  Click Save.

Thanks

Arun



Arun Patidar

Avatar

Level 2

Issue is fixed.

Root cause for the issue was the participant user was not present in the repository

Error description was misleading , it didn't state like user not found or anything similar.