JMS createQueue Trouble

Hi I am having problems using createQueue in JMS. I can create the queue successfully, but right after I try the following and it doesn't work. Any ideas? Thank.

QueueSender mySender = mySession.createSender(myQueue);

      

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

      

+2


source to share


1 answer


The JMS Exception is a layered data structure where the lower layer is for the JMS transport provider to set vendor specific errors, and the top layer is for errors in the JMS API. It is very difficult to tell from the stack trace what category this falls into. Note that this is not a WebSphere MQ thing, but rather a JMS thing. As best practice, always print JMS related exceptions!

Here is a code snippet showing it here: http://publib.boulder.ibm.com/infocenter/wmqv6/v6r0/topic/com.ibm.mq.csqzaw.doc/uj24500_.htm



By the way, although this is labeled as WebSphere MQ, the stack trace indicates that these are WebSphere App Server SI Bus Bus classes that are used as the JMS transport. However, the advice applies to JMS with any transport provider, and I still recommend printing the associated exception to see what's going on here.

+1


source







All Articles