com.ibm.mq.MQException
已经被这个问题困扰了几个小时了,有人有什么想法吗?
java.lang.NoSuchMethodError: com.ibm.mq.MQException.(Ljava/lang/String;Ljava/lang/String;II)V 在 com.ibm.msg.client.wmq.common.internal.Reason.createException(Reason.java:223) 在 com.ibm.msg.client.wmq.internal.WMQMessageConsumer.checkJmqiCallSuccess(WMQMessageConsumer.java:123) 在 com.ibm.msg.client.wmq.internal.WMQConsumerShadow.getMsg(WMQConsumerShadow.java:1198) 在 com.ibm.msg.client.wmq.internal.WMQSyncConsumerShadow.receiveInternal(WMQSyncConsumerShadow.java:233) 在 com.ibm.msg.client.wmq.internal.WMQConsumerShadow.receive(WMQConsumerShadow.java:922) 在 com.ibm.msg.client.wmq.internal.WMQMessageConsumer.receive(WMQMessageConsumer.java:450) 在 com.ibm.msg.client.jms.internal.JmsMessageConsumerImpl.receiveInboundMessage(JmsMessageConsumerImpl.java:742) 在 com.ibm.msg.client.jms.internal.JmsMessageConsumerImpl.receive(JmsMessageConsumerImpl.java:423) 在 com.ibm.mq.jms.MQMessageConsumer.receive(MQMessageConsumer.java:258)
当我使用 MQ 本机库放置消息并使用 JMS API 读取它们时,出现此错误。 jms 读取失败,抛出上述异常。我也在使用 jms Selector,这似乎是导致问题的原因。没有选择器一切正常。 TIA。
Have been stuck with this problem for a few hours now, anyone any ideas?
java.lang.NoSuchMethodError: com.ibm.mq.MQException.(Ljava/lang/String;Ljava/lang/String;II)V
at com.ibm.msg.client.wmq.common.internal.Reason.createException(Reason.java:223)
at com.ibm.msg.client.wmq.internal.WMQMessageConsumer.checkJmqiCallSuccess(WMQMessageConsumer.java:123)
at com.ibm.msg.client.wmq.internal.WMQConsumerShadow.getMsg(WMQConsumerShadow.java:1198)
at com.ibm.msg.client.wmq.internal.WMQSyncConsumerShadow.receiveInternal(WMQSyncConsumerShadow.java:233)
at com.ibm.msg.client.wmq.internal.WMQConsumerShadow.receive(WMQConsumerShadow.java:922)
at com.ibm.msg.client.wmq.internal.WMQMessageConsumer.receive(WMQMessageConsumer.java:450)
at com.ibm.msg.client.jms.internal.JmsMessageConsumerImpl.receiveInboundMessage(JmsMessageConsumerImpl.java:742)
at com.ibm.msg.client.jms.internal.JmsMessageConsumerImpl.receive(JmsMessageConsumerImpl.java:423)
at com.ibm.mq.jms.MQMessageConsumer.receive(MQMessageConsumer.java:258)
Am getting this error when i put the message using MQ native libraries and i read them using JMS API's. The jms read fails throwing the exception above. I am also using jms Selector which seems to be causing the problem. with out the selector everything works fine. TIA.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
最后我能够解决这个问题,这一切都与选择器的创建方式有关。不同之处在于 MQ API 将相关 ID 作为字节数组,而 JMS 将其作为字符串。因此,选择器无法选择消息并抛出已发布的错误。该错误根本不适合调试,因此必须进行大量的试验和错误。不管怎样,现在这有效了,所以我很高兴。下面是我为此必须做的代码更改:
参考了IBM文档中的代码。
Finally i was able to resolve this, it all had to do with how the selector is created. The difference was that MQ API's have correlation id as bytes array where as JMS takes it as a string. Due to this the Selector was unable to select the message and was throwing the posted error. The error is not at all debug friendly hence had to do a lot of trial and error. Anyways now this works so i am glad. Below is the code change i had to do for this:
Referred the code from IBM docs.
您的 MQ 库版本错误。尝试针对最新版本运行您的代码。
You've got wrong version of MQ libraries. Try to run your code against the newest versions.