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

There is no thread named "pyNS_CPMPortal106_CPMWorkThread1"

SA-29426

Summary



User is seeing an error in production with the activity @baseclass.CPMRemoveThread in ruleset PegaAppCA:07-12-01.


Error Messages



2016-10-12 00:30:16,000 [WebContainer : 13036] [WorkThread] [ CustSrv:01.20.01] ( internal.mgmt.Executable) ERROR  - Exception
java.lang.IllegalArgumentException: There is no thread named "pyNS_CPMPortal106_CPMWorkThread1"
at com.pega.pegarules.session.internal.mgmt.base.RequestorPassivation.removeInactiveThread(RequestorPassivation.java:704)
at com.pega.pegarules.session.internal.mgmt.PRRequestorImpl.removeInactiveThread(PRRequestorImpl.java:783)
at com.pegarules.generated.activity.ra_action_cpmremovethread_3e7b95b9b160e8a7909ef4c9d02a3d6a.step2_circum0(ra_action_cpmremovethread_3e7b95b9b160e8a7909ef4c9d02a3d6a.java:241)
at com.pegarules.generated.activity.ra_action_cpmremovethread_3e7b95b9b160e8a7909ef4c9d02a3d6a.perform(ra_action_cpmremovethread_3e7b95b9b160e8a7909ef4c9d02a3d6a.java:86)


Steps to Reproduce



Unknown


Root Cause



A defect in Pegasystems’ code or rules.  A check needs to be inserted to make sure the thread about to be removed exists. 

Resolution



Perform the following local-change:
  1. Copy CPMRemoveThread to one of your own rulesets. The code of step 2 of this activity currently is:
 
if (!sCurrentThreadName.equals(sThreadName) )
((com.pega.pegarules.priv.context.PegaRequestor)tools.getThread().getRequestor()).removeInactiveThread(sThreadName);


2. Change this step to the following: 
int appNameIndex = -1;
String appName = null;
 
if (!sCurrentThreadName.equals(sThreadName) ) {
                if (sCurrentThreadName != null && (appNameIndex = sCurrentThreadName.indexOf("/$")) > 0) {
                                appName = sCurrentThreadName.substring(0, appNameIndex);
                                if((sThreadName != null) && (!(sThreadName.indexOf(appName) >= 0))) {
                                                // If there's an appname in the thread name, retain same form
                                                sThreadName = appName + "/$" + sThreadName;
                                }
                }
 
                PRThread inactiveThread = tools.getThread().getRequestor().getThread(sThreadName);
                if (inactiveThread != null) {
                                       ((com.pega.pegarules.priv.context.PegaRequestor)tools.getThread().getRequestor()).removeInactiveThread(sThreadName);
                }
}

 

 

Suggest Edit

Published November 3, 2016 - Updated December 2, 2021

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