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

JMS MDB Listener running on WAS throws EJBException

SA-62510

Summary



Error occurs when Custom Message Driven Bean (MDB) deployed on WebSphere 8.5 uses the Java Message Service (JMS) messages from the JMS destination.  


Error Messages



000001ab PRBootstrap E pega.pegarules.internal.bootstrap.PRBootstrap Problem during method invocation(onMessage)
javax.ejb.EJBException:Unable to locate implementation of PegaRULES Engine class for EngineBMT
at pega.pegarules.session.internal.engineinterface.etier.mdb.PRJMSListener.callEngine(PRJMSListener.java:200)
at pega.pegarules.session.internal.engineinterface.etier.mdb.PRJMSListener.iniat(PRJMSListener.java:175)
at pega.pegarules.session.internal.engineinterface.etier.mdb.PRJMSListener.onMessage(PRJMSListener.java:122)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
pega.pegarules.boot.internal.extbridge.AppServerBridgeToPega.invokeMethodPropagatingThrowable(AppServerBridgeToPega.java:224)  pega.pegarules.boot.internal.extbridge.AppServerBridgeToPega.invokeMethod(AppServerBridgeToPega.java:273)    pega.pegarules.internal.etier.mdb.PRJMSListenerBoot.onMessage(PRJMSListenerBoot.java:91)      container.WASMessageEndpointHandler.invokeJMSMethod(WASMessageEndpointHandler.java:138)      MessageEndpointHandler.invokeMdbMethod(MessageEndpointHandler.java:1146)
mdb.MessageEndpointHandler.invoke(MessageEndpointHandler.java:844)
sun.proxy.$Proxy33.onMessage(Unknown Source)  connector.inbound.MessageEndpointWrapper.onMessage(MessageEndpointWrapper.java:136)MQSession$FacadeMessageListener.onMessage(MQSession.java:138)
msg.client.jms.internal.JmsSessionImpl.run(JmsSessionImpl.java:2677)
jms.MQSession.run(MQSession.java:963)
mq.connector.inbound.ASFWorkImpl.doDelivery(ASFWorkImpl.java:102)
mq.connector.inbound.AbstractWorkImpl.run(AbstractWorkImpl.java:240)

       

Steps to Reproduce

  1. Deploy an augmented prpc_j2ee14_ws.ear on the Web Application Server (WAS) 8.5 which contains the custom JMS MDB Listener 
  2. Send a message to the JMS Destination. Error generates in the StardardOut.log file


Root Cause



A defect or configuration issue in the operating environment. The error occurred due to the presence of modified deployment descriptors of the prweb.war module. JMS MDB Listener was added to the prbeans.jar module by modifying the out-of-the-box deployment descriptors which is not recommended.

Resolution



Make the following change to the operating environment:
Revert to the OOTB prpc_j2ee14_ws.ear and then add the JMS MDB Listener to a dedicated module by following the below steps:
  1. Download the custom MDB module generated by Pega from the JMS MDB Listener instance in the Pega Designer Studio
  2. Provide the JMS Destination Bindings at deployment time in the WebSphere console or statically define the bindings in the application server specific deployment descriptors (see below). In the latter case apply the steps described below:
  3. Unzip the original Pega EAR prpc_j2ee14_ws.ear
  4. Add the JAR module updated with the deployment descriptors
  5. Edit the application.xml file in the META-INF directory and add the below module:
    ...
    <!--ETier end-->
        <module id="EjbModule_1">
            <ejb>prbeans.jar</ejb>
        </module>
            <module id="CustomMDB_module">
            <ejb>CustomMDB.jar</ejb>
        </module>
        <module>
            <web>
                <web-uri>prweb.war</web-uri>
     ...
  6. Repackage and deploy the augmented EAR prpc_j2ee14_ws.ear
Define JMS Destination Bindings at deployment Time from the WebSphere Administration Console.

Deploy the augmented PRPC Ear with the custom MDB module using the IBM WebSphere Administration Console Deployment wizard. In the Message Driven Bean listener bindings step of the wizard, define a mapping with an existing Activation Specification or a Listener Port. This maps the custom MDB to the required JMS Destination. The MDB can be associated with a Listener Port or an Activation Specification binding. The mapping can be updated later at runtime using the WAS Admin Console by navigating as below: Applications > Enterprise Applications > PRPC_APP > Message Driven Bean listener bindings


Define a Static Binding in the application server specific deployment descriptors of the custom MDB module.

Define the Message-driven bean destination binding depending on the binding type of choice (Listener Port or an Activation Specification) by adding the relevant content to the WebSphere specific deployment descriptor named ibm-ejb-jar-bnd.xml.

The file must be present in the below path:

CustomMDB.jar#META-INF/ibm-ejb-jar-bnd.xml
  • Listener Port case
<?xml version="1.0" encoding="UTF-8"?>
<ejb-jar-bnd xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns="http://websphere.ibm.com/xml/ns/javaee"
xsi:schemaLocation="http://websphere.ibm.com/xml/ns/javaee http://websphere.ibm.com/xml/ns/javaee/ibm-ejb-jar-bnd_1_0.xsd" version="1.0">
<message-driven name="<My_MDB_Name>"> <!--The name here must be the same of the ejb-name element in the ejb-jar.xml file for the same module: ejb-jar.xml#/enterprise-beans/message-driven/ejb-name -->
<listener-port name="<My_Listener_Port_Name>"/>
<ejb-ref binding-name="ejb/PREngineBMT" name="ejb/EngineBMTLocal"/>
<ejb-ref binding-name="ejb/PREngineCMT" name="ejb/EngineCMTLocal"/>
</message-driven>
</ejb-jar-bnd>
  • Activation Specification case
<?xml version="1.0" encoding="UTF-8"?>
<ejb-jar-bnd xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns="http://websphere.ibm.com/xml/ns/javaee"
xsi:schemaLocation="http://websphere.ibm.com/xml/ns/javaee http://websphere.ibm.com/xml/ns/javaee/ibm-ejb-jar-bnd_1_0.xsd" version="1.0">
<message-driven name="<My_MDB_Name>"> <!--The name here must be the same of the ejb-name element in the ejb-jar.xml file for the same module: ejb-jar.xml#/enterprise-beans/message-driven/ejb-name -->
<jca-adapter activation-spec-binding-name="<JNDI_name_of_ActivationSpec>" destination-binding-name="<JNDI_name_of_JMS_Destination>"/>
<ejb-ref binding-name="ejb/PREngineBMT" name="ejb/EngineBMTLocal"/>
<ejb-ref binding-name="ejb/PREngineCMT" name="ejb/EngineCMTLocal"/>
</message-driven>
</ejb-jar-bnd>

 

Published August 15, 2019 - Updated October 8, 2020

Was this useful?

0% found this useful

Have a question? Get answers now.

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

Did you find this content helpful?

Want to help us improve this content?

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