I'm having some struggles getting a Java web-application running on IBM WebSphere Application Server 9.0.5.5 sending messages to an IBM MQ topic using log4j 1.2.17.
In WAS we originally had a ConnectionFactory
set up to use to communicate with the topic. This is what we do with other applications that use IBM MQ queues. However, this ends up giving me the following error:
java.lang.ClassCastException: com.ibm.ejs.jms.JMSConnectionFactoryHandle incompatible with javax.jms.TopicConnectionFactory
I found an IBM article that discusses a similar issue with queues and the solution is to use a QueueConnectionFactory
. So, similarly I switched from using a ConnectionFactory
to a TopicConnectionFactory
. Now I get this error:
java.lang.ClassCastException: com.ibm.ejs.jms.JMSTopicConnectionFactoryHandle incompatible with javax.jms.TopicConnectionFactory
I have another Java web-application that uses log4j2 with queues. We have a ConnectionFactory
set up in WAS in Resources > JMS as we did here with this application. It all works fine. The only difference here is that we are using log4j 1.2.17 and topics instead of queues.
I cannot change the version of log4j because it is baked into the vendor platform we have.
I checked the WAR file that is being deployed and there is only the one jms.jar
(and fscontext, providerutil, mq, etc. JARs for IBM MQ Client 9.1.0.0) in there. So no other competing jms.jar
that might be of an older JMS version.
Any ideas what could be wrong here?