简体   繁体   English

创建JMS连接时出现JmqiException

[英]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. 我正在开发一个Spring Boot JMS应用程序,该应用程序连接到IBM MQ以发送和接收JMS消息。 I have used the following maven dependencies for the same 我已经使用了以下Maven依赖项

    <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. 我将wmq.jmsra.rar部署到Payara 4服务器,配置了所有队列连接工厂JNDI和Queue管理对象。 After this when I deploy the war file of the application I am getting an error 此后,当我部署应用程序的war文件时,出现错误

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. 我检查了许多在线论坛,但找不到任何解决方案,它似乎与某些JAR冲突有关,但我不确定。

I replaced the maven dependencies to resolve the issue. 我替换了Maven依赖项来解决此问题。 There was a conflict with one of the jar files from mq-jms-spring-boot-starter dependency which was causing the problem 与来自mq-jms-spring-boot-starter依赖项的jar文件之一发生冲突,这导致了问题

    <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>

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM