So I checked the Linked exception which says com.ibm.mq.MQException:
Completion Code 2, Reason 2184 at
com.ibm.mq.MQQueueManager.accessQueue(MQQueueManager.java:1151) at
com.ibm.mq.jms.MQQueueSession.getOutputQueue(MQQueueSession.java:724)
at com.ibm.mq.jms.MQQueueSession.createSender(MQQueueSession.java:179)
at edebit.MqHandlerBean.ejbCreate(MqHandlerBean.java:75)
Basically, I've created a QueueManager as crtmqm -q
saturn.queue.manager strmqm saturn.queue.manager runmqsc
saturn.queue.manager <<! define qlocal (MYLOCAL.QUEUE) usage (xmitq)
define qremote (LOCAL.DEF.OF.REMOTE.QUEUE) rname (ORANGE.QUEUE) rqmname
('venus.queue.manager') xmitq (MYLOCAL.QUEUE) define channel
(FIRST.CHANNEL) chltype (sdr) conname ('169.165.102.110(6011)') xmitq
(MYLOCAL.QUEUE) trptype (tcp) end
!
runmqlsr -t tcp -p 6022 -m saturn.queue.manager &
Then I created a QCF and Q in MQ JMS Admin tool as DEFINE
QCF(mytestQCF) DEFINE Q(MYLOCAL.QUEUE) QUEUE(xmitq)
QMGR(saturn.queue.manager) DEFINE Q(LOCAL.DEF.OF.REMOTE.QUEUE)
QMGR(saturn.queue.manager)
Then I tried to send message using the following JavaCode as: String qcf
= "mytestQCF"; String qname = "LOCAL.DEF.OF.REMOTE.QUEUE";
java.util.Hashtable env = new java.util.Hashtable();
env.put(Context.INITIAL_CONTEXT_FACTORY,
"com.sun.jndi.fscontext.RefFSContextFactory"); if (url != null)
env.put(Context.PROVIDER_URL, "file://169.165.102.110/opt/mqm");
env.put(Context.REFERRAL, "throw"); ctx = new InitialContext(env);
factory = (QueueConnectionFactory)ctx.lookup(qcf); connection =
factory.createQueueConnection(); session =
connection.createQueueSession(false, Session.AUTO_ACKNOWLEDGE); ioQueue
= (Queue)ctx.lookup(qname); connection.start();
queueSender = session.createSender(ioQueue); txtMsg = sendMsg("Sample
message from MqHandler Bean");
Can anyone let me what the problem is.Any suggestion will really be a
great help. Thanks Anand
--
www.MainFrameForum.com - USENET Gateway