Salesforce

Generic JMS Adapter connection to ActiveMQ 5.17.x or later ActiveMQ 5.x releases fails

« Go Back

Information

 
TitleGeneric JMS Adapter connection to ActiveMQ 5.17.x or later ActiveMQ 5.x releases fails
URL NameGeneric-JMS-Adapter-connection-to-ActiveMQ-5-17-x-fails
Article Number000229940
EnvironmentProduct: OpenEdge
Version: 12.2 and later
OS: All supported platforms
Other: Generic JMS Adapter
Question/Problem Description

The ABL client hangs when trying to connect to an ActiveMQ 5.17.x, ActiveMQ 5.18.x or later ActiveMQ 5.x broker using the -SMQConnect parameter.
The ABL client hangs when trying to connect to an ActiveMQ 5.17.x, ActiveMQ 5.18.x or later ActiveMQ 5.x broker using the -SMQConnect parameter.

The oemessaging utility throws the following exception when trying to connect to an ActiveMQ 5.17.x, ActiveMQ 5.18.x or later ActiveMQ 5.x broker:
java.lang.NoClassDefFoundError: org/apache/logging/log4j/spi/AbstractLoggerAdapter

Steps to Reproduce
Clarifying Information
The same ABL code works fine with ActiveMQ 5.16.x or earlier.

Followed the steps outlined in the following documentation to configure the Generic JMS Adapter:
https://docs.progress.com/bundle/openedge-jms-adapter-122/page/Install-the-Progress-OpenEdge-JMS-Adapter.html

Code similar to the following is used to connect to the ActiveMQ Broker via ClientConnect:
RUN jms/jmssession.p PERSISTENT SET ptpsession ("-SMQConnect").

Code similar to the following is used to connect to the ActiveMQ Broker via BrokerConnect:
RUN jms/jmssession.p PERSISTENT SET ptpsession ("-H localhost -S 3620 -DirectConnect").
 

If ClientConnect is used, the ABL program hangs when running the 'beginSession' procedure.

If BrokerConnect is used, the following exception appears in the oemessaging console:

Failed to instantiate SLF4J LoggerFactory
Reported exception:
java.lang.NoClassDefFoundError: org/apache/logging/log4j/spi/AbstractLoggerAdapter
        at java.base/java.lang.ClassLoader.defineClass1(Native Method)
        at java.base/java.lang.ClassLoader.defineClass(ClassLoader.java:1017)
        at java.base/java.security.SecureClassLoader.defineClass(SecureClassLoader.java:174)
        at java.base/jdk.internal.loader.BuiltinClassLoader.defineClass(BuiltinClassLoader.java:800)
        at java.base/jdk.internal.loader.BuiltinClassLoader.findClassOnClassPathOrNull(BuiltinClassLoader.java:698)
        at java.base/jdk.internal.loader.BuiltinClassLoader.loadClassOrNull(BuiltinClassLoader.java:621)
        at java.base/jdk.internal.loader.BuiltinClassLoader.loadClass(BuiltinClassLoader.java:579)
        at java.base/jdk.internal.loader.ClassLoaders$AppClassLoader.loadClass(ClassLoaders.java:178)
        at java.base/java.lang.ClassLoader.loadClass(ClassLoader.java:522)
        at org.slf4j.impl.StaticLoggerBinder.<clinit>(StaticLoggerBinder.java:37)
        at org.slf4j.LoggerFactory.bind(LoggerFactory.java:150)
        at org.slf4j.LoggerFactory.performInitialization(LoggerFactory.java:124)
        at org.slf4j.LoggerFactory.getILoggerFactory(LoggerFactory.java:417)
        at org.slf4j.LoggerFactory.getLogger(LoggerFactory.java:362)
        at org.slf4j.LoggerFactory.getLogger(LoggerFactory.java:388)
        at org.apache.activemq.ActiveMQConnectionFactory.<clinit>(ActiveMQConnectionFactory.java:62)
        at java.base/java.lang.Class.forName0(Native Method)
        at java.base/java.lang.Class.forName(Class.java:315)
        at com.progress.messaging.jms.MQProviderImpl.getInstance(MQProviderImpl.java:92)
        at com.progress.messaging.jms.jms.createConnectionFactory(jms.java:104)
        at com.progress.messaging.jms.jms._connect(jms.java:309)
        at com.progress.javafrom4gl.implementation.JavaServlet.<init>(JavaServlet.java:81)
        at com.progress.javafrom4gl.implementation.ServiceImpl.createConnectionServlet(ServiceImpl.java:106)
        at com.progress.ubroker.broker.ubServerThreadIPC.write(ubServerThreadIPC.java:433)
        at com.progress.ubroker.broker.ubASserverThread.processConnect(ubASserverThread.java:574)
        at com.progress.ubroker.broker.ubServerThread.processEvent(ubServerThread.java:1210)
        at com.progress.ubroker.broker.ubServerThread.mainline(ubServerThread.java:479)
        at com.progress.ubroker.broker.ubServerThread.run(ubServerThread.java:356)
Caused by: java.lang.ClassNotFoundException: org.apache.logging.log4j.spi.AbstractLoggerAdapter
        at java.base/jdk.internal.loader.BuiltinClassLoader.loadClass(BuiltinClassLoader.java:581)
        at java.base/jdk.internal.loader.ClassLoaders$AppClassLoader.loadClass(ClassLoaders.java:178)
        at java.base/java.lang.ClassLoader.loadClass(ClassLoader.java:522)
        ... 28 more


If BrokerConnect is used, the following exception appears in the genericMQ1.server.log file:

java.lang.Exception: org.apache.activemq.ActiveMQConnectionFactory class file not mentioned correctly: java.lang.NoClassDefFoundError: org/apache/logging/log4j/spi/AbstractLoggerAdapter
    at com.progress.messaging.jms.jms.createConnectionFactory(jms.java:125)
    at com.progress.messaging.jms.jms._connect(jms.java:309)
    at com.progress.javafrom4gl.implementation.JavaServlet.<init>(JavaServlet.java:81)
    at com.progress.javafrom4gl.implementation.ServiceImpl.createConnectionServlet(ServiceImpl.java:106)
    at com.progress.ubroker.broker.ubServerThreadIPC.write(ubServerThreadIPC.java:433)
    at com.progress.ubroker.broker.ubASserverThread.processConnect(ubASserverThread.java:574)
    at com.progress.ubroker.broker.ubServerThread.processEvent(ubServerThread.java:1210)
    at com.progress.ubroker.broker.ubServerThread.mainline(ubServerThread.java:479)
    at com.progress.ubroker.broker.ubServerThread.run(ubServerThread.java:356)


If BrokerConnect is used, the following exception appears in the oemessaging console after adding the log4j-api-2.19.0.jar file to the JMSCLIENTJAR environment variable:

ERROR StatusLogger Log4j2 could not find a logging implementation. Please add log4j-core to the classpath. Using SimpleLogger to log to the console...

Error Messageoemessaging console and genericMQ1.server.log file:
java.lang.Exception: org.apache.activemq.ActiveMQConnectionFactory class file not mentioned correctly: java.lang.NoClassDefFoundError: org/apache/logging/log4j/spi/AbstractLoggerAdapter


oemessaging console:
ERROR StatusLogger Log4j2 could not find a logging implementation. Please add log4j-core to the classpath. Using SimpleLogger to log to the console...
Defect Number
Enhancement Number
Cause
ActiveMQ 5.17.x now uses Log4j 2.x and the Log4j 2.x JAR files are missing from the Generic JMS Adapter classpath.
Resolution
ClientConnect
Add the log4j-api-2.19.0.jar and log4j-core-2.19.0.jar files to the Generic JMS Adapter classpath in %DLC%\properties\JavaTools.properties. For example:
[SonicMQ]
classpath=C:\apache-activemq-5.17.4\lib\client\activemq-all-5.17.4.jar,C:\apache-activemq-5.17.4\lib\optional\log4j-api-2.19.0.jar,C:\apache-activemq-5.17.4\lib\optional\log4j-core-2.19.0.jar
jvmargs=-DsonicMQExtensions=false -DjmsProvider=ActiveMQ

BrokerConnect
Add the log4j-api-2.19.0.jar and log4j-core-2.19.0.jar files to the JMSCLIENTJAR environment variable before starting the oemessaging utility. For example:
SET JMSPROVIDER=ActiveMQ
SET JMSCLIENTJAR=C:\apache-activemq-5.17.4\lib\client\activemq-all-5.17.4.jar;C:\apache-activemq-5.17.4\lib\optional\log4j-api-2.19.0.jar;C:\apache-activemq-5.17.4\lib\optional\log4j-core-2.19.0.jar

oemessaging start
Note: When defining multiple JAR files in the JMSCLIENTJAR environment variable, they need to be separated by a semicolon on Windows and by a colon on Linux.
Workaround
Notes
Keyword Phrase
Last Modified Date9/18/2024 12:03 PM

Powered by