ClassNotFoundException in JNDI lookup of remote JMS CF
In a Pega Platform 8.1.1 application deployed on JBoss EAP 7.1, a remote JMS Connection Factory exposed by a different JBoss EAP 7.1 application server (AS) instance is looked up.
The resources exposed by the remote application server are configured correctly. A plain Java client application is used to resolve the required resources and messages are sent or received to/from the remote destination.
In the Pega application, Java Naming and Directory Interface (JNDI) Server and Java Message Service (JMS) Connector rules are created. However, error occurs while testing the connectivity from the JMS Connector rule.
JNDI lookup of JMS connection factory 'jms/RemoteConnectionFactory' failed: javax.naming.NamingException: Failed to lookup [Root exception is java.lang.ClassNotFoundException: org.apache.activemq.artemis.jms.client.ActiveMQJMSConnectionFactory]
Steps to Reproduce
- Create and configure a JNDI Server rule to address the remote JBoss JNDI server.
- Create a JMS Producer Module with a Point-to-Point domain.
- Create and configure a JMS Connector using Direct JNDI Lookup.
- Manually input the Connection Factory JNDI name.
- Click Test Connectivity. Exception occurs.
A defect or configuration issue in the operating environment.
Since the remote JMS integration scenario involved the same application server version, additional JMS client libraries need not be imported because the application server already provided the required libraries.
However, the existing ActiveMQ Artemis libraries provided by JBoss must be exposed in the application classpath.
When this step is not performed, a ClassNotFoundException occurred during the unmarshalling of the remote JNDI reference retrieved through the JNDI lookup.
Make the following change to the operating environment:
Edit the JBoss EAP 7.1 configuration file in use (standalone-[full|ha].xml or domain.xml) to add a global module which exposes the ActiveMQ Artemis libraries to deploy applications.
<module name="org.apache.activemq.artemis" slot="main"/>