Support Article
NPE: MQ messages prohibit the server restart
SA-39909
Summary
When user has messages in queues and user makes an attempt to restart the servers, JMS MDB Listeners execution fail with errors during the server restart and also includes all the pending messages in the queues in error state.
Error Messages
ERROR JMS|SvcPkg|Services|SvcMethod|A707161827B7807D571BD15D1FBDD9FF4 - Exception
java.lang.NullPointerException
at com.pega.pegarules.generation.internal.PRGenProviderImpl.get(PRGenProviderImpl.java:474)
at com.pega.pegarules.session.internal.mgmt.Executable.doActivity(Executable.java:3488)
at com.pega.pegarules.session.internal.mgmt.base.ThreadRunner.runActivitiesAlt(ThreadRunner.java:646)
at com.pega.pegarules.session.internal.mgmt.PRThreadImpl.runActivitiesAlt(PRThreadImpl.java:461)
at com.pega.pegarules.integration.engine.internal.services.ServiceAPI.runActivities(ServiceAPI.java:1882)
at com.pega.pegarules.session.external.engineinterface.service.EngineAPI.processRequestInner(EngineAPI.java:385)
at sun.reflect.GeneratedMethodAccessor49.invoke(Unknown Source)
Steps to Reproduce
Restart application server with JMS messages waiting in the destination to be processed.
Root Cause
A defect or configuration issue in the operating environment.
The JMS MDB Listeners are throwing Exceptions because the JBoss server starts the MDB instances before the PegaRULES engine has completely initialized.
Resolution
Make the following change to the operating environment:
Refer to section “4.2.1 Delivery Active” in the following link:
https://access.redhat.com/documentation/enus/red_hat_jboss_enterprise_application_platform/7.0/html/developing_ejb_applications/message_driven_beans-1
And then perform the following local-change steps:
Configuring Delivery Active in the jboss-ejb3.xml File
1. Add the namespace prefix for the urn:delivery-active:1.0 as highlighted below as an attribute of the <jboss:ejb-jar> element.
<?xml version="1.1" encoding="UTF-8"?>
<jboss:ejb-jar xmlns:jboss="http://www.jboss.com/xml/ns/javaee"
xmlns="http://java.sun.com/xml/ns/javaee"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns:d="urn:delivery-active:1.0"
xsi:schemaLocation="http://www.jboss.com/xml/ns/javaee
2. Modify assembly descriptor to include the delivery element.
<assembly-descriptor>
.. .. ..
<d:delivery>
<ejb-name>MDB_NAME</ejb-name>
<d:active>false</d:active>
</d:delivery>
.. .. ..
<assembly-descriptor>
3. Start the server and ensure that the PegaRULES engine has been successfully started.
4. Execute the following JBoss Client script.
cli /bin/jboss-cli.sh
driven-bean=<MDB_NAME>:start-delivery()
Published August 29, 2017 - Updated October 8, 2020
Have a question? Get answers now.
Visit the Collaboration Center to ask questions, engage in discussions, share ideas, and help others.