Search code examples
spring-bootjmsibm-mqspring-jmspayara

JmqiException while creating JMS connection


I am working on a spring boot JMS application which connects to IBM MQ to send and receive JMS message. I have used the following maven dependencies for the same

    <dependency>
        <groupId>com.fasterxml.jackson.core</groupId>
        <artifactId>jackson-databind</artifactId>
    </dependency>

    <dependency>
        <groupId>com.ibm.mq</groupId>
        <artifactId>mq-jms-spring-boot-starter</artifactId>
        <version>0.0.3</version>
    </dependency>

I deployed the wmq.jmsra.rar to the Payara 4 server, configured all the queue connection factory JNDI and Queue admin objects. After this when I deploy the war file of the application I am getting an error

org.springframework.jms.UncategorizedJmsException: Uncategorized exception occurred during JMS processing; nested exception is com.ibm.msg.client.jms.DetailedJMSException: MQJCA1011: Failed to allocate a JMS connection.
An internal error caused an attempt to allocate a connection to fail.
See the linked exception for details of the failure.
at org.springframework.jms.support.JmsUtils.convertJmsAccessException(JmsUtils.java:316)

With the root cause as

Caused by: java.lang.NoSuchMethodException: com.ibm.mq.jmqi.remote.api.RemoteFAP.<init>(com.ibm.mq.jmqi.JmqiEnvironment, int)
at java.lang.Class.getConstructor0(Class.java:3082)
at java.lang.Class.getConstructor(Class.java:1825)
at com.ibm.mq.jmqi.JmqiEnvironment.getInstance(JmqiEnvironment.java:702)
... 112 common frames omitted

I am not sure what the issue could be. I checked many online forums however couldn't find any solution, it seems to be related to some JAR conflict but I am not sure.


Solution

  • I replaced the maven dependencies to resolve the issue. There was a conflict with one of the jar files from mq-jms-spring-boot-starter dependency which was causing the problem

        <dependency>
            <groupId>com.fasterxml.jackson.core</groupId>
            <artifactId>jackson-databind</artifactId>
        </dependency>
        <dependency>
            <groupId>org.springframework</groupId>
            <artifactId>spring-jms</artifactId>
            <version>4.3.12.RELEASE</version>
            <scope>compile</scope>
        </dependency>
        <dependency>
            <groupId>javax.jms</groupId>
            <artifactId>javax.jms-api</artifactId>
            <version>2.0.1</version>
            <scope>provided</scope>
        </dependency>