1
Caused by: org.springframework.beans.BeanInstantiationException: Failed to instantiate [org.springframework.jms.core.JmsTemplate]: Factory method 'jmsTemplate' threw exception with message: class com.ibm.mq.jms.MQConnectionFactory cannot be cast to class jakarta.jms.ConnectionFactory (com.ibm.mq.jms.MQConnectionFactory and jakarta.jms.ConnectionFactory are in unnamed module of loader 'app')
    at org.springframework.beans.factory.support.SimpleInstantiationStrategy.instantiate(SimpleInstantiationStrategy.java:171)
    at org.springframework.beans.factory.support.ConstructorResolver.instantiate(ConstructorResolver.java:653)
    ... 66 common frames omitted
Caused by: java.lang.ClassCastException: class com.ibm.mq.jms.MQConnectionFactory cannot be cast to class jakarta.jms.ConnectionFactory (com.ibm.mq.jms.MQConnectionFactory and jakarta.jms.ConnectionFactory are in unnamed module of loader 'app')

Issue might be because of IBM MQ is not supporting higher version or not compatible with spring 6 but not sure. looking for the resolution for the issue.

New contributor
Sudhir Ahirkar is a new contributor to this site. Take care in asking for clarification, commenting, and answering. Check out our Code of Conduct.
1
  • Please clarify your specific problem or provide additional details to highlight exactly what you need. As it's currently written, it's hard to tell exactly what you're asking.
    – Community Bot
    Mar 16 at 0:50

1 Answer 1

2

MQ provides Jakarta-compatible packages. You have to change your dependencies to use the correct module.

If you're using the MQ Spring Boot library, then use the corresponding V3.x.x artifact.

If you are directly referencing the MQ client libraries, then use com.ibm.mq.jakarta.client instead of the com.ibm.mq.allclient.

Your Answer

Sudhir Ahirkar is a new contributor. Be nice, and check out our Code of Conduct.

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.