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]
# 1

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.

shirish_wagh at 2007-6-29 2:57:18 > top of Java-index,Enterprise & Remote Computing,Enterprise Technologies...
# 2
see them at, http://www-4.ibm.com/software/ts/mqseries/library/manualsa/amqzao/amqzao0m.htm
mchan0 at 2007-6-29 2:57:18 > top of Java-index,Enterprise & Remote Computing,Enterprise Technologies...
# 3

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.

zaneparks at 2007-6-29 2:57:18 > top of Java-index,Enterprise & Remote Computing,Enterprise Technologies...
# 4

Correct. That is what is puzzling me. The Options should have been transparent with the JMS implementation I got the error codes but still I dont have a clue as to what is happening. Do u think there might be something wrong in the MQ server setup? (currently it runs on a compaq Himalaya machine)

Thanks,

Ram

m_ansram at 2007-6-29 2:57:18 > top of Java-index,Enterprise & Remote Computing,Enterprise Technologies...
# 5
I doubt it's the MQSeries server setup. If you can do gets and puts using the Java API, there isn't a problem there. Do you get the same result writing your own simple JMS receiver and doing a put from the console or using amqsput?
zaneparks at 2007-6-29 2:57:18 > top of Java-index,Enterprise & Remote Computing,Enterprise Technologies...
# 6
Yes, I get the same problem when reading the queue using my own receiverRam
m_ansram at 2007-6-29 2:57:18 > top of Java-index,Enterprise & Remote Computing,Enterprise Technologies...