Skip to main content

This content has been archived and is no longer being updated. Links may not function; however, this content may be relevant to outdated versions of the product.

Support Article

NullPointerException in SendEmailNotification



A java.lang.NullPointerException (NPE) is encountered when running the out-of-the-box SendEmailNotification activity. 

Error Messages

Caused by: java.lang.NullPointerException
at com.pegarules.generated.pega_rules_default.getCheckBoxBoolean(
at com.pegarules.generated.activity.ra_activity_your_class_agentqueuelist_sendemailnotification_7114e39a18e4b0d7f71a42ae14e24c3e.step1_circum0(
at com.pegarules.generated.activity.ra_activity_your_class_agentqueuelist_sendemailnotification_7114e39a18e4b0d7f71a42ae14e24c3e.perform(
at com.pega.pegarules.engine.runtime.Executable.doActivity( Code))

Steps to Reproduce

1. Create an activity and open the Data-EmailAccount instance using Obj-Open
2. Get the list of agents running on current node with QueueID,RuleSetName, and Node details
3. For each agent on the current node, call another activity (Activity2) to restart the agent
4. In another activity, get the QueueID,RuleSetName
5. Using java method call API AgentUtils.startQueue(ruleSetName,queueNumber) to start the agent
6. Build a page list for each agent started
7. For each agent started call SendEmailNotification activity to send notification for the agent started


Root Cause

A defect in Pegasystems’ code or rules. Calling AgentUtils.startQueue() eventually gets a lock on the master agent requestor and when that lock is released, ThreadContainer.clear() is called. So subsequently ThreadContainer.get() returns null. This is a side effect of this line in Agent.updateInstanceForQueueFlag() which is called during startQueue() processing.


Perform the following local-change:

Use ThreadContainer.get() to save the PRThread value before the call to AgentUtils.startQueue(), then ThreadContainer.put() to restore the value afterwards.
Suggest Edit

Published January 31, 2016 - Updated October 8, 2020

Did you find this content helpful? Yes No

Have a question? Get answers now.

Visit the Collaboration Center to ask questions, engage in discussions, share ideas, and help others.

We'd prefer it if you saw us at our best.

Pega Community has detected you are using a browser which may prevent you from experiencing the site as intended. To improve your experience, please update your browser.

Close Deprecation Notice
Contact us