Support Article

Email listeners failing on restart

SA-37030

Summary



On an application restart or start, a file listener starts and begins processing before dependent application code is fully loaded, if files are contained within target folder.
This results in NullPointerExceptions in the code and potentially unhandled or dealt with code, It leaves with emails marked as read and no processes created.


Error Messages



2017-03-18 18:05:31,170 [ EMAIL-Thread-27] [ STANDARD] [ABCApp:04.22.01] ( internal.services.ServiceAPI) ERROR EMAIL.WHDEmailCaseListenerInfoGrupowe.Listener|from(SOMEEMAIL@EMAIL.ORG)|sub(Prośba o z)|Email|EmailDefault|Work-|CreateEmaiCaselFlowInfoGrupowe|REQUESTOR emailuser - Service Exception:
com.pega.pegarules.pub.PRRuntimeError: PRRuntimeError
at com.pega.pegarules.session.internal.mgmt.base.ThreadRunner.runActivitiesAlt(ThreadRunner.java:712)
at com.pega.pegarules.session.internal.mgmt.PRThreadImpl.runActivitiesAlt(PRThreadImpl.java:461)
at com.pega.pegarules.integration.engine.internal.services.ServiceAPI.runActivities(ServiceAPI.java:1881)
at com.pega.pegarules.session.external.engineinterface.service.EngineAPI.processRequestInner(EngineAPI.java:385)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:498)
at com.pega.pegarules.session.internal.PRSessionProviderImpl.performTargetActionWithLock(PRSessionProviderImpl.java:1270)
at com.pega.pegarules.session.internal.PRSessionProviderImpl.doWithRequestorLocked(PRSessionProviderImpl.java:1008)
at com.pega.pegarules.session.internal.PRSessionProviderImpl.doWithRequestorLocked(PRSessionProviderImpl.java:841)
at com.pega.pegarules.session.external.engineinterface.service.EngineAPI.processRequest(EngineAPI.java:331)
at com.pega.pegarules.integration.engine.internal.services.email.EmailListener.handleStandardRequest(EmailListener.java:3601)
at com.pega.pegarules.integration.engine.internal.services.email.EmailListener.handleRequestContents(EmailListener.java:3967)
at com.pega.pegarules.integration.engine.internal.services.email.EmailListener.handleRequest(EmailListener.java:3835)
at com.pega.pegarules.integration.engine.internal.services.email.EmailListener.emailProcess(EmailListener.java:3422)
at com.pega.pegarules.integration.engine.internal.services.email.EmailListener.oneIteration(EmailListener.java:2731)
at com.pega.pegarules.integration.engine.internal.services.email.EmailListener.run_(EmailListener.java:2590)
at com.pega.pegarules.integration.engine.internal.services.listener.ServiceListenerBaseImpl.run(ServiceListenerBaseImpl.java:453)
at java.lang.Thread.run(Thread.java:745)
Caused by: java.lang.NullPointerException
at com.pega.pegarules.session.internal.mgmt.base.RequestorChildren.queueBatchActivity(RequestorChildren.java:216)
at com.pega.pegarules.session.internal.mgmt.base.RequestorChildren.queueBatchActivity(RequestorChildren.java:174)
at com.pega.pegarules.session.internal.mgmt.PRRequestorImpl.queueBatchActivity(PRRequestorImpl.java:1125)
at com.pega.pegarules.exec.internal.declare.infengine.ChainingEngineUtilImpl.runActivity(ChainingEngineUtilImpl.java:283)
at com.pega.pegarules.exec.internal.declare.infengine.TriggerImpl.evaluateNetworks(TriggerImpl.java:307)
at com.pega.pegarules.data.internal.access.DatabaseImpl.performTriggers(DatabaseImpl.java:12805)
at com.pega.pegarules.data.internal.access.DatabaseImpl.performCommitTriggers(DatabaseImpl.java:2799)
at com.pega.pegarules.data.internal.access.DatabaseImpl.attemptToProcessUpdates(DatabaseImpl.java:2609)
at com.pega.pegarules.data.internal.access.DatabaseImpl.processUpdates(DatabaseImpl.java:2308)
at com.pega.pegarules.data.internal.access.DatabaseImpl.commit(DatabaseImpl.java:2047)
at com.pegarules.generated.activity.ra_action_commitwitherrorhandling_6c6c3f21ead5ea2a97cdc30349237e37.step4_circum0


Steps to Reproduce



Exceptions are noticed on restart of the server instance while there are email items in the queue Email Listener's queue


Root Cause



A defect in Pegasystems’ code or rules:
EmailListener was not performing the check for the node state before processing the emails from the email listener's queue


Resolution



Deploy HFix-33777

Published April 25, 2017

Have a question? Get answers now.

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