Error retreiving messages from Queue
Hi Friends,
I am trying to retreive messages from a queue on a remote machine where MQ server has been setup correctly.(nojndi ) I am able to fetch the messages correctly when I use the MQ Base Java API. But I get an exception when I use JMS Api. I am able to put messages on the queue with both MQ base API and JMS API.
When I run the IVTRun program with -nojndi switch I get the following error
C:\Program Files\IBM\MQSeries\Java\bin>IVTRun -nojndi -client -m PINQMGR -host pinnsd01m-0.sabre.com
WebGain Java! JustInTime Compiler Version 4.00.007(x) for JDK 1.2
Copyright (C) 2000 WebGain, Inc.
5648-C60 (c) Copyright IBM Corp. 1999. All Rights Reserved.
MQSeries classes for Java(tm) Message Service 5.200
Installation Verification Test
Creating a QueueConnectionFactory
Creating a Connection
Creating a Session
Creating a Queue
Creating a QueueSender
Creating a QueueReceiver
Creating a TextMessage
Sending the message to SYSTEM.DEFAULT.LOCAL.QUEUE
Reading the message back again
Caught exception: javax.jms.JMSException: MQJMS2002: failed to get message from MQ queue
com.ibm.mq.MQException: Completion Code 2, Reason 2046
IVT finished
I also tried several combinations of the channel switch but still getting the same error.
Does any one knows abt error 2046. I cant see the documentation for any of these errors anywhere and i would be grateful if I get pointers on this.
Advanced Thanks,
Ram
[1576 byte] By [
m_ansram] at [2007-9-26 1:50:18]

here's an explanation for error code 2046. I will look into why you are getting that if I get time later.
MQRC_OPTIONS_ERROR
The Options parameter or field contains options that are not valid, or a combination of options that is not valid.
For the MQOPEN , MQCLOSE , MQXCNVC , mqBagToBuffer, mqBufferToBag, mqCreateBag, and mqExecute calls, Options is a separate parameter on the call.
This reason also occurs if the parameter pointer is not valid. (It is not always possible to detect parameter pointers that are not valid; if not detected, unpredictable results occur.)
For the MQBEGIN , MQCONNX , MQGET , MQPUT , and MQPUT1 calls, Options is a field in the relevant options structure (MQBO, MQCNO, MQGMO, or MQPMO).
Corrective action: Specify valid options. Check the description of the Options parameter or field to determine which options and combinations of options are valid. If multiple options are being set by adding the individual options together, ensure that the same option is not added twice.
2046 is MQRC_OPTIONS_ERROR. In this case, it would be an error on the get options. Don't know exactly what's going on here. They don't give the source for MQIVT, so it's not clear how to proceed and in any case, get options should be transparent in the JMS implementation.
There's a manual called amqzao02.pdf with error messages. That should have come with your installation of MQSeries. It's available online at
http://www-4.ibm.com/software/ts/mqseries/library/manualsa/amqzao02/amqzao02tfrm.htm
A couple of gottchas when dealing with the two Java APIs. When you're sending a message from MQSeries Java API to MQSeries JMS implementation and the JMS app wants to get a text message, you need to specify a message format of MQFMT_STRING in the sending program. When going the other way, you need to specify that the receiving application is non-JMS.