ASG
IBM
Zystems
Cressida
Icon
Netflexity
 
  MQSeries.net
Search  Search       Tech Exchange      Education      Certifications      Library      Info Center      SupportPacs      LinkedIn  Search  Search                                                                   FAQ  FAQ   Usergroups  Usergroups
 
Register  ::  Log in Log in to check your private messages
 
RSS Feed - WebSphere MQ Support RSS Feed - Message Broker Support

MQSeries.net Forum Index » IBM MQ Java / JMS » MQException with MessageConsumer.receive() and 2019 error

Post new topic  Reply to topic
 MQException with MessageConsumer.receive() and 2019 error « View previous topic :: View next topic » 
Author Message
arcgang
PostPosted: Wed May 02, 2007 3:19 pm    Post subject: MQException with MessageConsumer.receive() and 2019 error Reply with quote

Novice

Joined: 02 May 2007
Posts: 16

Hi ,

I am getting the following exception..Not able to figure out what is the problem..Can any1 please throw some light on this..

I am using WAS 6.1 in my local pc, the MQ is installed in a linux machine..

The exception is throwing at the line marked as bold.
Just to give a background..Previously, I had been testing this same code against the WAS default messaging provider..with local queues on my machine..Messages were sent to an MDB and MDB in turn placed response messages to the reply queue..The below replyhandler was able to receive messages from that queue but changing to MQ is causing the exception to occur at the server RESTART.

I can put messages to the MQ queue using a JMS Producer implementation but the below consumer fails..

[code] while (running) {
try {
Message message = null;
[b]message = queueReceiver.receive();[/b]

if (message != null) {
int messageID = message.getIntProperty("messageID");

TextMessage txtMessage = (TextMessage)message;
String messageBody = txtMessage.getText();

try {
iMessageReply.messageReceived(messageID, messageBody);
} catch (Throwable e) {
logger
.error("EQCEventMessageReplyHandler : Throwable occurred while messageReceived() method is invoked"
+ e.getMessage());
throw new RuntimeException(e);
}

}
} catch (JMSException e) {
logger
.error("EQCEventMessageReplyHandler : JMSException while getting the message from the queue jms/eventReply."
+ e.getMessage());
throw new RuntimeException(e);
}
}[/code]



The exception thrown is as follows :


[code][3/05/07 10:37:27:281 NZST] 00000029 SystemErr R Exception in thread "EQCEventMessageReplyHandler" java.lang.RuntimeException: javax.jms.JMSException: MQJMS2002: failed to get message from MQ queue
[3/05/07 10:37:27:281 NZST] 00000029 SystemErr R at com.ibm.nzeqc.cms.plugin.messaging.EQCEventMessageReplyHandler.run(EQCEventMessageReplyHandler.java:103)
[3/05/07 10:37:27:281 NZST] 00000029 SystemErr R Caused by: javax.jms.JMSException: MQJMS2002: failed to get message from MQ queue
at com.ibm.mq.jms.services.ConfigEnvironment.newException(ConfigEnvironment.java:567)
at com.ibm.mq.jms.MQMessageConsumer.getMessage(MQMessageConsumer.java:3457)
at com.ibm.mq.jms.MQMessageConsumer.receiveInternal(MQMessageConsumer.java:2663)
at com.ibm.mq.jms.MQMessageConsumer.receive(MQMessageConsumer.java:2425)
at com.ibm.ejs.jms.JMSMessageConsumerHandle.receive(JMSMessageConsumerHandle.java:442)
at com.ibm.nzeqc.cms.plugin.messaging.EQCEventMessageReplyHandler.run(EQCEventMessageReplyHandler.java:77)
---- Begin backtrace for Nested Throwables
com.ibm.mq.MQException: MQJE001: Completion Code 2, Reason 2019
at com.ibm.mq.MQQueue.getMsg2(MQQueue.java:1071)
at com.ibm.mq.jms.MQMessageConsumer.getMessage(MQMessageConsumer.java:3226)
at com.ibm.mq.jms.MQMessageConsumer.receiveInternal(MQMessageConsumer.java:2663)
at com.ibm.mq.jms.MQMessageConsumer.receive(MQMessageConsumer.java:2425)
at com.ibm.ejs.jms.JMSMessageConsumerHandle.receive(JMSMessageConsumerHandle.java:442)
at com.ibm.nzeqc.cms.plugin.messaging.EQCEventMessageReplyHandler.run(EQCEventMessageReplyHandler.java:77)

[3/05/07 10:37:27:281 NZST] 00000029 SystemErr R at com.ibm.mq.jms.services.ConfigEnvironment.newException(ConfigEnvironment.java:567)
[3/05/07 10:37:27:281 NZST] 00000029 SystemErr R at com.ibm.mq.jms.MQMessageConsumer.getMessage(MQMessageConsumer.java:3457)
[3/05/07 10:37:27:281 NZST] 00000029 SystemErr R at com.ibm.mq.jms.MQMessageConsumer.receiveInternal(MQMessageConsumer.java:2663)
[3/05/07 10:37:27:281 NZST] 00000029 SystemErr R at com.ibm.mq.jms.MQMessageConsumer.receive(MQMessageConsumer.java:2425)
[3/05/07 10:37:27:281 NZST] 00000029 SystemErr R at com.ibm.ejs.jms.JMSMessageConsumerHandle.receive(JMSMessageConsumerHandle.java:442)
[3/05/07 10:37:27:281 NZST] 00000029 SystemErr R at com.ibm.nzeqc.cms.plugin.messaging.EQCEventMessageReplyHandler.run(EQCEventMessageReplyHandler.java:77)
[/code]
Back to top
View user's profile Send private message
Vitor
PostPosted: Thu May 03, 2007 12:36 am    Post subject: Re: MQException with MessageConsumer.receive() and 2019 erro Reply with quote

Grand High Poobah

Joined: 11 Nov 2005
Posts: 26093
Location: Texas, USA

arcgang wrote:
com.ibm.mq.MQException: MQJE001: Completion Code 2, Reason 2019


Do a search for this reason code. It has been discussed before; the reason itself indicates the MQ object you're using is corrupt, invalid or out of scope.

Happy Reading!
_________________
Honesty is the best policy.
Insanity is the best defence.
Back to top
View user's profile Send private message
arcgang
PostPosted: Thu May 03, 2007 2:23 am    Post subject: Reply with quote

Novice

Joined: 02 May 2007
Posts: 16

I have searched for the reason code...it says something to do with HOBJ handle...and the description says that somehow one of the threads is calling MQClose... But the same set of code works against the WAS default messaging provider+MDB...

The exception is thrown at the MessageConsumer.receive() method...
Back to top
View user's profile Send private message
fjb_saper
PostPosted: Thu May 03, 2007 11:32 am    Post subject: Reply with quote

Grand High Poobah

Joined: 18 Nov 2003
Posts: 20756
Location: LI,NY

Look at multithreading this way:

All threads:Same qcf
Each thread its own:
  • connection
  • session
  • receivers / senders


That's why you have pooling...
Enjoy
_________________
MQ & Broker admin
Back to top
View user's profile Send private message Send e-mail
Display posts from previous:   
Post new topic  Reply to topic Page 1 of 1

MQSeries.net Forum Index » IBM MQ Java / JMS » MQException with MessageConsumer.receive() and 2019 error
Jump to:  



You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
Protected by Anti-Spam ACP
 
 


Theme by Dustin Baccetti
Powered by phpBB © 2001, 2002 phpBB Group

Copyright © MQSeries.net. All rights reserved.