tags:

views:

153

answers:

1

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)
A: 

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.

T.Rob