JMS createQueue 问题
您好,我在 JMS 中使用 createQueue 时遇到问题。我可以成功创建队列,但在我尝试执行以下操作后却失败了。有什么想法吗?谢谢。
QueueSender mySender = mySession.createSender(myQueue);
出现错误:
javax.jms.InvalidDestinationException: CWSIA0062E: Failed to create a MessageProducer for queue://Q2?busName=myBus2
at com.ibm.ws.sib.api.jms.impl.JmsMsgProducerImpl.<init>(JmsMsgProducerImpl.java:396)
at com.ibm.ws.sib.api.jms.impl.JmsQueueSenderImpl.<init>(JmsQueueSenderImpl.java:60)
at com.ibm.ws.sib.api.jms.impl.JmsQueueSessionImpl.instantiateProducer(JmsQueueSessionImpl.java:224)
at com.ibm.ws.sib.api.jms.impl.JmsSessionImpl.createProducer(JmsSessionImpl.java:865)
at com.ibm.ws.sib.api.jms.impl.JmsQueueSessionImpl.createSender(JmsQueueSessionImpl.java:147)
Hi I am having trouble using the createQueue in JMS. I can create a queue successfully but right after I try to do the following and it fails. Any ideas? Thanks.
QueueSender mySender = mySession.createSender(myQueue);
With the error:
javax.jms.InvalidDestinationException: CWSIA0062E: Failed to create a MessageProducer for queue://Q2?busName=myBus2
at com.ibm.ws.sib.api.jms.impl.JmsMsgProducerImpl.<init>(JmsMsgProducerImpl.java:396)
at com.ibm.ws.sib.api.jms.impl.JmsQueueSenderImpl.<init>(JmsQueueSenderImpl.java:60)
at com.ibm.ws.sib.api.jms.impl.JmsQueueSessionImpl.instantiateProducer(JmsQueueSessionImpl.java:224)
at com.ibm.ws.sib.api.jms.impl.JmsSessionImpl.createProducer(JmsSessionImpl.java:865)
at com.ibm.ws.sib.api.jms.impl.JmsQueueSessionImpl.createSender(JmsQueueSessionImpl.java:147)
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
JMS 异常是一个多级数据结构,其中较低级别用于 JMS 传输提供程序放置特定于供应商的错误,顶层用于 JMS API 中的错误。从堆栈跟踪中很难判断它属于哪个类别。请注意,这不是 WebSphere MQ 的事情,而是 JMS 的事情。作为最佳实践,请始终打印 JMS 链接的异常!
这里有一个代码片段显示了这一点:
http:// publib.boulder.ibm.com/infocenter/wmqv6/v6r0/topic/com.ibm.mq.csqzaw.doc/uj24500_.htm
顺便说一句,虽然它被标记为 WebSphere MQ,但堆栈跟踪表明它是用作 JMS 传输的 WebSphere App Server 的 SI Bus 类。然而,该建议适用于任何传输提供商的 JMS,我仍然建议打印链接的异常以查看这里到底发生了什么。
The JMS exception is a multi-level data structure where the lower level is for the JMS transport provider to put vendor-specific errors and the top level is for errors in the JMS API. It is very difficult to tell from the stack trace provided which category this falls into. Note that this is not a WebSphere MQ thing, but rather a JMS thing. As a best practice, always print JMS linked exceptions!
There's a code snippet showing this here:
http://publib.boulder.ibm.com/infocenter/wmqv6/v6r0/topic/com.ibm.mq.csqzaw.doc/uj24500_.htm
Incidentally, although this is tagged as WebSphere MQ, the stack trace indicates that it is WebSphere App Server's SI Bus classes that are being used as the JMS transport. However, the advice applies to JMS with any transport provider and I'd still recommend printing the linked exception to see what's really going on here.