我正在开发一个Spring Boot JMS应用程序,该应用程序连接到IBM MQ以发送和接收JMS消息。我已经使用了以下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>
我将wmq.jmsra.rar部署到Payara 4服务器,配置了所有队列连接工厂JNDI和Queue管理对象。此后,当我部署应用程序的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)
根本原因为
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
我不确定可能是什么问题。我检查了许多在线论坛,但找不到任何解决方案,它似乎与某些JAR冲突有关,但我不确定。
答案 0 :(得分:1)
我替换了Maven依赖项以解决此问题。与导致问题的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>